Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: chrome/browser/android/chrome_application.cc

Issue 2768023002: Move remaining @CalledByNative methods out of ChromeApplication. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/chrome_application.h" 5 #include "chrome/browser/android/chrome_application.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/android/context_utils.h" 9 #include "base/android/context_utils.h"
10 #include "base/android/jni_android.h" 10 #include "base/android/jni_android.h"
11 #include "base/android/jni_string.h" 11 #include "base/android/jni_string.h"
12 #include "chrome/browser/android/tab_android.h"
13 #include "chrome/browser/browser_process.h" 12 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/net/predictor.h" 13 #include "chrome/browser/net/predictor.h"
15 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
17 #include "chrome/common/chrome_content_client.h" 16 #include "chrome/common/chrome_content_client.h"
18 #include "components/prefs/pref_service.h" 17 #include "components/prefs/pref_service.h"
19 #include "content/public/browser/browser_thread.h" 18 #include "content/public/browser/browser_thread.h"
20 #include "content/public/browser/storage_partition.h" 19 #include "content/public/browser/storage_partition.h"
21 #include "content/public/browser/web_contents.h"
22 #include "jni/ChromeApplication_jni.h" 20 #include "jni/ChromeApplication_jni.h"
23 #include "net/cookies/cookie_store.h" 21 #include "net/cookies/cookie_store.h"
24 #include "net/url_request/url_request_context.h" 22 #include "net/url_request/url_request_context.h"
25 #include "net/url_request/url_request_context_getter.h" 23 #include "net/url_request/url_request_context_getter.h"
26 24
27 using base::android::ConvertUTF8ToJavaString; 25 using base::android::ConvertUTF8ToJavaString;
28 using base::android::JavaParamRef; 26 using base::android::JavaParamRef;
29 using base::android::ScopedJavaLocalRef; 27 using base::android::ScopedJavaLocalRef;
30 28
31 namespace { 29 namespace {
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 std::vector<Profile*> loaded_profiles = 89 std::vector<Profile*> loaded_profiles =
92 g_browser_process->profile_manager()->GetLoadedProfiles(); 90 g_browser_process->profile_manager()->GetLoadedProfiles();
93 std::for_each(loaded_profiles.begin(), loaded_profiles.end(), 91 std::for_each(loaded_profiles.begin(), loaded_profiles.end(),
94 RemoveSessionCookiesForProfile); 92 RemoveSessionCookiesForProfile);
95 } 93 }
96 94
97 namespace chrome { 95 namespace chrome {
98 namespace android { 96 namespace android {
99 97
100 // static 98 // static
101 bool ChromeApplication::RegisterBindings(JNIEnv* env) { 99 bool ChromeApplication::RegisterBindings(JNIEnv* env) {
Ted C 2017/03/23 03:41:15 can we delete this file now?
estevenson 2017/03/24 18:15:59 Not quite yet, need to remove the native methods f
102 return RegisterNativesImpl(env); 100 return RegisterNativesImpl(env);
103 } 101 }
104 102
105 void ChromeApplication::ShowPasswordSettings() {
106 Java_ChromeApplication_showPasswordSettings(
107 base::android::AttachCurrentThread(),
108 base::android::GetApplicationContext());
109 }
110
111 void ChromeApplication::OpenClearBrowsingData(
112 content::WebContents* web_contents) {
113 TabAndroid* tab = TabAndroid::FromWebContents(web_contents);
114 DCHECK(tab);
115 Java_ChromeApplication_openClearBrowsingData(
116 base::android::AttachCurrentThread(),
117 base::android::GetApplicationContext(), tab->GetJavaObject());
118 }
119
120 bool ChromeApplication::AreParentalControlsEnabled() {
121 return Java_ChromeApplication_areParentalControlsEnabled(
122 base::android::AttachCurrentThread(),
123 base::android::GetApplicationContext());
124 }
125
126 } // namespace android 103 } // namespace android
127 } // namespace chrome 104 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698