OLD | NEW |
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/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void ChangeAppStatusOnIOThread(SafeBrowsingService* sb_service, | 74 void ChangeAppStatusOnIOThread(SafeBrowsingService* sb_service, |
75 jboolean foreground) { | 75 jboolean foreground) { |
76 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 76 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
77 SafeBrowsingProtocolManager* proto_manager = sb_service->protocol_manager(); | 77 SafeBrowsingProtocolManager* proto_manager = sb_service->protocol_manager(); |
78 if (proto_manager) | 78 if (proto_manager) |
79 proto_manager->SetAppInForeground(foreground); | 79 proto_manager->SetAppInForeground(foreground); |
80 } | 80 } |
81 | 81 |
82 } // namespace | 82 } // namespace |
83 | 83 |
84 static ScopedJavaLocalRef<jstring> GetBrowserUserAgent(JNIEnv* env, | 84 static jstring GetBrowserUserAgent(JNIEnv* env, jclass clazz) { |
85 jclass clazz) { | 85 return ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); |
86 return ConvertUTF8ToJavaString(env, GetUserAgent()); | |
87 } | 86 } |
88 | 87 |
89 static void FlushPersistentData(JNIEnv* env, jclass obj) { | 88 static void FlushPersistentData(JNIEnv* env, jclass obj) { |
90 // Commit the prending writes for all the loaded profiles. | 89 // Commit the prending writes for all the loaded profiles. |
91 std::vector<Profile*> loaded_profiles = | 90 std::vector<Profile*> loaded_profiles = |
92 g_browser_process->profile_manager()->GetLoadedProfiles(); | 91 g_browser_process->profile_manager()->GetLoadedProfiles(); |
93 std::for_each(loaded_profiles.begin(), loaded_profiles.end(), | 92 std::for_each(loaded_profiles.begin(), loaded_profiles.end(), |
94 CommitPendingWritesForProfile); | 93 CommitPendingWritesForProfile); |
95 | 94 |
96 if (g_browser_process->local_state()) | 95 if (g_browser_process->local_state()) |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 } | 142 } |
144 | 143 |
145 bool ChromeApplication::AreParentalControlsEnabled() { | 144 bool ChromeApplication::AreParentalControlsEnabled() { |
146 return Java_ChromeApplication_areParentalControlsEnabled( | 145 return Java_ChromeApplication_areParentalControlsEnabled( |
147 base::android::AttachCurrentThread(), | 146 base::android::AttachCurrentThread(), |
148 base::android::GetApplicationContext()); | 147 base::android::GetApplicationContext()); |
149 } | 148 } |
150 | 149 |
151 } // namespace android | 150 } // namespace android |
152 } // namespace chrome | 151 } // namespace chrome |
OLD | NEW |