1 // Copyright 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "chrome/browser/android/chromium_application.h" 6 7 #include "base/android/jni_android.h" 8 #include "chrome/browser/android/tab_android.h" 9 #include "content/public/browser/web_contents.h" 10 #include "jni/ChromiumApplication_jni.h" 11 12 namespace chrome { 13 namespace android { 14 15 // static 16 bool ChromiumApplication::RegisterBindings(JNIEnv* env) { 17 return RegisterNativesImpl(env); 18 } 19 20 void ChromiumApplication::OpenProtectedContentSettings() { 21 Java_ChromiumApplication_openProtectedContentSettings( 22 base::android::AttachCurrentThread(), 23 base::android::GetApplicationContext()); 24 } 25 26 void ChromiumApplication::ShowSyncSettings() { 27 Java_ChromiumApplication_showSyncSettings( 28 base::android::AttachCurrentThread(), 29 base::android::GetApplicationContext()); 30 } 31 32 void ChromiumApplication::ShowAutofillSettings() { 33 Java_ChromiumApplication_showAutofillSettings( 34 base::android::AttachCurrentThread(), 35 base::android::GetApplicationContext()); 36 } 37 38 void ChromiumApplication::ShowTermsOfServiceDialog() { 39 Java_ChromiumApplication_showTermsOfServiceDialog( 40 base::android::AttachCurrentThread(), 41 base::android::GetApplicationContext()); 42 } 43 44 void ChromiumApplication::OpenClearBrowsingData( 45 content::WebContents* web_contents) { 46 TabAndroid* tab = TabAndroid::FromWebContents(web_contents); 47 DCHECK(tab); 48 Java_ChromiumApplication_openClearBrowsingData( 49 base::android::AttachCurrentThread(), 50 base::android::GetApplicationContext(), 51 tab->GetJavaObject().obj()); 52 } 53 54 bool ChromiumApplication::AreParentalControlsEnabled() { 55 return Java_ChromiumApplication_areParentalControlsEnabled( 56 base::android::AttachCurrentThread(), 57 base::android::GetApplicationContext()); 58 } 59 60 } // namespace android 61 } // namespace chrome 62