14e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 24e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 34e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// found in the LICENSE file. 44e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 54e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "chrome/browser/android/chromium_application.h" 64e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 74e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "base/android/jni_android.h" 8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "chrome/browser/android/tab_android.h" 9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "content/public/browser/web_contents.h" 104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "jni/ChromiumApplication_jni.h" 114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 124e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)namespace chrome { 134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)namespace android { 144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// static 164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)bool ChromiumApplication::RegisterBindings(JNIEnv* env) { 174e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) return RegisterNativesImpl(env); 184e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} 194e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)void ChromiumApplication::OpenProtectedContentSettings() { 214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) Java_ChromiumApplication_openProtectedContentSettings( 224e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) base::android::AttachCurrentThread(), 234e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) base::android::GetApplicationContext()); 244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} 254e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles) 261e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)void ChromiumApplication::ShowSyncSettings() { 271e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) Java_ChromiumApplication_showSyncSettings( 281e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) base::android::AttachCurrentThread(), 291e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) base::android::GetApplicationContext()); 301e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)} 311e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 321320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tuccivoid ChromiumApplication::ShowAutofillSettings() { 331320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci Java_ChromiumApplication_showAutofillSettings( 341320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci base::android::AttachCurrentThread(), 351320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci base::android::GetApplicationContext()); 361320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci} 371320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci 381e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)void ChromiumApplication::ShowTermsOfServiceDialog() { 391e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) Java_ChromiumApplication_showTermsOfServiceDialog( 401e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) base::android::AttachCurrentThread(), 411e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) base::android::GetApplicationContext()); 421e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles)} 431e9bf3e0803691d0a228da41fc608347b6db4340Torne (Richard Coles) 44cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)void ChromiumApplication::OpenClearBrowsingData( 45cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) content::WebContents* web_contents) { 46cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) TabAndroid* tab = TabAndroid::FromWebContents(web_contents); 47cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) DCHECK(tab); 48cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) Java_ChromiumApplication_openClearBrowsingData( 49cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) base::android::AttachCurrentThread(), 50cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) base::android::GetApplicationContext(), 51cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) tab->GetJavaObject().obj()); 52cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)} 53cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles) 545d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)bool ChromiumApplication::AreParentalControlsEnabled() { 555d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) return Java_ChromiumApplication_areParentalControlsEnabled( 565d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) base::android::AttachCurrentThread(), 575d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) base::android::GetApplicationContext()); 585d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} 595d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 604e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} // namespace android 614e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)} // namespace chrome 62