• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
RegisterBindings(JNIEnv * env)16 bool ChromiumApplication::RegisterBindings(JNIEnv* env) {
17   return RegisterNativesImpl(env);
18 }
19 
OpenProtectedContentSettings()20 void ChromiumApplication::OpenProtectedContentSettings() {
21   Java_ChromiumApplication_openProtectedContentSettings(
22       base::android::AttachCurrentThread(),
23       base::android::GetApplicationContext());
24 }
25 
ShowSyncSettings()26 void ChromiumApplication::ShowSyncSettings() {
27   Java_ChromiumApplication_showSyncSettings(
28       base::android::AttachCurrentThread(),
29       base::android::GetApplicationContext());
30 }
31 
ShowTermsOfServiceDialog()32 void ChromiumApplication::ShowTermsOfServiceDialog() {
33   Java_ChromiumApplication_showTermsOfServiceDialog(
34       base::android::AttachCurrentThread(),
35       base::android::GetApplicationContext());
36 }
37 
OpenClearBrowsingData(content::WebContents * web_contents)38 void ChromiumApplication::OpenClearBrowsingData(
39     content::WebContents* web_contents) {
40   TabAndroid* tab = TabAndroid::FromWebContents(web_contents);
41   DCHECK(tab);
42   Java_ChromiumApplication_openClearBrowsingData(
43       base::android::AttachCurrentThread(),
44       base::android::GetApplicationContext(),
45       tab->GetJavaObject().obj());
46 }
47 
AreParentalControlsEnabled()48 bool ChromiumApplication::AreParentalControlsEnabled() {
49   return Java_ChromiumApplication_areParentalControlsEnabled(
50       base::android::AttachCurrentThread(),
51       base::android::GetApplicationContext());
52 }
53 
54 }  // namespace android
55 }  // namespace chrome
56