Add more checks to investigate SupervisedUserPrefStore crash at startup.
[chromium-blink-merge.git] / chrome / browser / android / chromium_application.cc
blob0def8e8f4aafcab4fdfc93d6b0917713c7074556
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.
5 #include "chrome/browser/android/chromium_application.h"
7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h"
9 #include "chrome/browser/android/tab_android.h"
10 #include "chrome/common/chrome_content_client.h"
11 #include "content/public/browser/web_contents.h"
12 #include "jni/ChromiumApplication_jni.h"
14 using base::android::ConvertUTF8ToJavaString;
16 static jstring GetBrowserUserAgent(JNIEnv* env, jclass clazz) {
17 return ConvertUTF8ToJavaString(env, GetUserAgent()).Release();
20 namespace chrome {
21 namespace android {
23 // static
24 bool ChromiumApplication::RegisterBindings(JNIEnv* env) {
25 return RegisterNativesImpl(env);
28 void ChromiumApplication::OpenProtectedContentSettings() {
29 Java_ChromiumApplication_openProtectedContentSettings(
30 base::android::AttachCurrentThread(),
31 base::android::GetApplicationContext());
34 void ChromiumApplication::ShowAutofillSettings() {
35 Java_ChromiumApplication_showAutofillSettings(
36 base::android::AttachCurrentThread(),
37 base::android::GetApplicationContext());
40 void ChromiumApplication::ShowPasswordSettings() {
41 Java_ChromiumApplication_showPasswordSettings(
42 base::android::AttachCurrentThread(),
43 base::android::GetApplicationContext());
46 void ChromiumApplication::OpenClearBrowsingData(
47 content::WebContents* web_contents) {
48 TabAndroid* tab = TabAndroid::FromWebContents(web_contents);
49 DCHECK(tab);
50 Java_ChromiumApplication_openClearBrowsingData(
51 base::android::AttachCurrentThread(),
52 base::android::GetApplicationContext(),
53 tab->GetJavaObject().obj());
56 bool ChromiumApplication::AreParentalControlsEnabled() {
57 return Java_ChromiumApplication_areParentalControlsEnabled(
58 base::android::AttachCurrentThread(),
59 base::android::GetApplicationContext());
62 } // namespace android
63 } // namespace chrome