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

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

Issue 1308363003: Revert of jni_generator: Make all object-returning natives return ScopedJavaLocalRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/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
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
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
OLDNEW
« no previous file with comments | « base/android/library_loader/library_loader_hooks.cc ('k') | chrome/browser/android/download/chrome_download_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698