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

Side by Side Diff: chrome/browser/ui/android/page_info/page_info_popup_android.cc

Issue 2785913002: [subresource_filter] Add the Content Settings UI for Android (Closed)
Patch Set: nits (trybots prev) Created 3 years, 8 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 | « chrome/browser/android/preferences/pref_service_bridge.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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/ui/android/page_info/page_info_popup_android.h" 5 #include "chrome/browser/ui/android/page_info/page_info_popup_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // particular order, but only if their value is different from the default. 110 // particular order, but only if their value is different from the default.
111 std::vector<ContentSettingsType> permissions_to_display; 111 std::vector<ContentSettingsType> permissions_to_display;
112 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_GEOLOCATION); 112 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_GEOLOCATION);
113 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); 113 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
114 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC); 114 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
115 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_NOTIFICATIONS); 115 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_NOTIFICATIONS);
116 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_IMAGES); 116 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_IMAGES);
117 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_JAVASCRIPT); 117 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_JAVASCRIPT);
118 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_POPUPS); 118 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_POPUPS);
119 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_AUTOPLAY); 119 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_AUTOPLAY);
120 permissions_to_display.push_back(CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER);
Ted C 2017/04/05 17:15:54 this doesn't need to be conditionally included bas
Charlie Harrison 2017/04/05 17:25:17 Yep this is correct.
120 121
121 std::map<ContentSettingsType, ContentSetting> 122 std::map<ContentSettingsType, ContentSetting>
122 user_specified_settings_to_display; 123 user_specified_settings_to_display;
123 124
124 for (const auto& permission : permission_info_list) { 125 for (const auto& permission : permission_info_list) {
125 if (base::ContainsValue(permissions_to_display, permission.type)) { 126 if (base::ContainsValue(permissions_to_display, permission.type)) {
126 if (permission.setting != CONTENT_SETTING_DEFAULT) { 127 if (permission.setting != CONTENT_SETTING_DEFAULT) {
127 user_specified_settings_to_display[permission.type] = 128 user_specified_settings_to_display[permission.type] =
128 permission.setting; 129 permission.setting;
129 } else if (permission.type == CONTENT_SETTINGS_TYPE_GEOLOCATION) { 130 } else if (permission.type == CONTENT_SETTINGS_TYPE_GEOLOCATION) {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 static_cast<jint>(CONTENT_SETTING_ALLOW)); 162 static_cast<jint>(CONTENT_SETTING_ALLOW));
162 } 163 }
163 164
164 Java_PageInfoPopup_updatePermissionDisplay(env, popup_jobject_); 165 Java_PageInfoPopup_updatePermissionDisplay(env, popup_jobject_);
165 } 166 }
166 167
167 // static 168 // static
168 bool PageInfoPopupAndroid::RegisterPageInfoPopupAndroid(JNIEnv* env) { 169 bool PageInfoPopupAndroid::RegisterPageInfoPopupAndroid(JNIEnv* env) {
169 return RegisterNativesImpl(env); 170 return RegisterNativesImpl(env);
170 } 171 }
OLDNEW
« no previous file with comments | « chrome/browser/android/preferences/pref_service_bridge.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698