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

Side by Side Diff: chrome/browser/android/preferences/website_preference_bridge.cc

Issue 2219923002: JNI: allow either JavaRef or bare objects in Java calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unreachable line Created 4 years, 4 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
« no previous file with comments | « base/android/scoped_java_ref.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/preferences/website_preference_bridge.h" 5 #include "chrome/browser/android/preferences/website_preference_bridge.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 if (is_incognito) 65 if (is_incognito)
66 profile = profile->GetOffTheRecordProfile(); 66 profile = profile->GetOffTheRecordProfile();
67 return profile; 67 return profile;
68 } 68 }
69 69
70 HostContentSettingsMap* GetHostContentSettingsMap(bool is_incognito) { 70 HostContentSettingsMap* GetHostContentSettingsMap(bool is_incognito) {
71 return HostContentSettingsMapFactory::GetForProfile( 71 return HostContentSettingsMapFactory::GetForProfile(
72 GetActiveUserProfile(is_incognito)); 72 GetActiveUserProfile(is_incognito));
73 } 73 }
74 74
75 typedef void (*InfoListInsertionFunction)(JNIEnv*, jobject, jstring, jstring); 75 typedef void (*InfoListInsertionFunction)(
76 JNIEnv*,
77 const base::android::JavaRefOrBare<jobject>&,
78 const base::android::JavaRefOrBare<jstring>&,
79 const base::android::JavaRefOrBare<jstring>&);
76 80
77 void GetOrigins(JNIEnv* env, 81 void GetOrigins(JNIEnv* env,
78 ContentSettingsType content_type, 82 ContentSettingsType content_type,
79 InfoListInsertionFunction insertionFunc, 83 InfoListInsertionFunction insertionFunc,
80 jobject list, 84 jobject list,
81 jboolean managedOnly) { 85 jboolean managedOnly) {
82 ContentSettingsForOneType all_settings; 86 ContentSettingsForOneType all_settings;
83 HostContentSettingsMap* content_settings_map = 87 HostContentSettingsMap* content_settings_map =
84 GetHostContentSettingsMap(false); // is_incognito 88 GetHostContentSettingsMap(false); // is_incognito
85 content_settings_map->GetSettingsForOneType( 89 content_settings_map->GetSettingsForOneType(
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 GURL url(ConvertJavaStringToUTF8(env, jorigin)); 789 GURL url(ConvertJavaStringToUTF8(env, jorigin));
786 scoped_refptr<SiteDataDeleteHelper> site_data_deleter( 790 scoped_refptr<SiteDataDeleteHelper> site_data_deleter(
787 new SiteDataDeleteHelper(profile, url)); 791 new SiteDataDeleteHelper(profile, url));
788 site_data_deleter->Run(); 792 site_data_deleter->Run();
789 } 793 }
790 794
791 // Register native methods 795 // Register native methods
792 bool RegisterWebsitePreferenceBridge(JNIEnv* env) { 796 bool RegisterWebsitePreferenceBridge(JNIEnv* env) {
793 return RegisterNativesImpl(env); 797 return RegisterNativesImpl(env);
794 } 798 }
OLDNEW
« no previous file with comments | « base/android/scoped_java_ref.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698