OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/website_settings/website_settings_ui.h" | 5 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "chrome/browser/plugins/plugins_field_trial.h" | 8 #include "chrome/browser/plugins/plugins_field_trial.h" |
9 #include "chrome/common/chrome_features.h" | |
9 #include "chrome/grit/chromium_strings.h" | 10 #include "chrome/grit/chromium_strings.h" |
10 #include "chrome/grit/generated_resources.h" | 11 #include "chrome/grit/generated_resources.h" |
11 #include "chrome/grit/theme_resources.h" | 12 #include "chrome/grit/theme_resources.h" |
12 #include "components/strings/grit/components_strings.h" | 13 #include "components/strings/grit/components_strings.h" |
13 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
14 #include "ui/base/resource/resource_bundle.h" | 15 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/gfx/image/image.h" | 16 #include "ui/gfx/image/image.h" |
16 | 17 |
17 namespace { | 18 namespace { |
18 | 19 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 const PermissionsUIInfo kPermissionsUIInfo[] = { | 82 const PermissionsUIInfo kPermissionsUIInfo[] = { |
82 {CONTENT_SETTINGS_TYPE_COOKIES, 0, IDR_BLOCKED_COOKIES, | 83 {CONTENT_SETTINGS_TYPE_COOKIES, 0, IDR_BLOCKED_COOKIES, |
83 IDR_ACCESSED_COOKIES}, | 84 IDR_ACCESSED_COOKIES}, |
84 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_WEBSITE_SETTINGS_TYPE_IMAGES, | 85 {CONTENT_SETTINGS_TYPE_IMAGES, IDS_WEBSITE_SETTINGS_TYPE_IMAGES, |
85 IDR_BLOCKED_IMAGES, IDR_ALLOWED_IMAGES}, | 86 IDR_BLOCKED_IMAGES, IDR_ALLOWED_IMAGES}, |
86 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_WEBSITE_SETTINGS_TYPE_JAVASCRIPT, | 87 {CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_WEBSITE_SETTINGS_TYPE_JAVASCRIPT, |
87 IDR_BLOCKED_JAVASCRIPT, IDR_ALLOWED_JAVASCRIPT}, | 88 IDR_BLOCKED_JAVASCRIPT, IDR_ALLOWED_JAVASCRIPT}, |
88 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_WEBSITE_SETTINGS_TYPE_POPUPS, | 89 {CONTENT_SETTINGS_TYPE_POPUPS, IDS_WEBSITE_SETTINGS_TYPE_POPUPS, |
89 IDR_BLOCKED_POPUPS, IDR_ALLOWED_POPUPS}, | 90 IDR_BLOCKED_POPUPS, IDR_ALLOWED_POPUPS}, |
90 #if defined(ENABLE_PLUGINS) | 91 #if defined(ENABLE_PLUGINS) |
91 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_WEBSITE_SETTINGS_TYPE_PLUGINS, | 92 {CONTENT_SETTINGS_TYPE_PLUGINS, IDS_WEBSITE_SETTINGS_TYPE_FLASH, |
raymes
2016/09/15 02:54:53
As we discussed - we need to clarify/ensure this w
raymes
2016/09/15 03:21:34
Now that I think about this more, I don't think th
tommycli
2016/09/15 16:40:45
I filed this bug: https://bugs.chromium.org/p/chro
| |
92 IDR_BLOCKED_POPUPS, IDR_ALLOWED_PLUGINS}, | 93 IDR_BLOCKED_PLUGINS, IDR_ALLOWED_PLUGINS}, |
93 #endif | 94 #endif |
94 {CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_WEBSITE_SETTINGS_TYPE_LOCATION, | 95 {CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_WEBSITE_SETTINGS_TYPE_LOCATION, |
95 IDR_BLOCKED_LOCATION, IDR_ALLOWED_LOCATION}, | 96 IDR_BLOCKED_LOCATION, IDR_ALLOWED_LOCATION}, |
96 {CONTENT_SETTINGS_TYPE_NOTIFICATIONS, | 97 {CONTENT_SETTINGS_TYPE_NOTIFICATIONS, |
97 IDS_WEBSITE_SETTINGS_TYPE_NOTIFICATIONS, IDR_BLOCKED_NOTIFICATION, | 98 IDS_WEBSITE_SETTINGS_TYPE_NOTIFICATIONS, IDR_BLOCKED_NOTIFICATION, |
98 IDR_ALLOWED_NOTIFICATION}, | 99 IDR_ALLOWED_NOTIFICATION}, |
99 {CONTENT_SETTINGS_TYPE_FULLSCREEN, IDS_WEBSITE_SETTINGS_TYPE_FULLSCREEN, | 100 {CONTENT_SETTINGS_TYPE_FULLSCREEN, IDS_WEBSITE_SETTINGS_TYPE_FULLSCREEN, |
100 IDR_ALLOWED_FULLSCREEN, IDR_ALLOWED_FULLSCREEN}, | 101 IDR_ALLOWED_FULLSCREEN, IDR_ALLOWED_FULLSCREEN}, |
101 {CONTENT_SETTINGS_TYPE_MOUSELOCK, IDS_WEBSITE_SETTINGS_TYPE_MOUSELOCK, | 102 {CONTENT_SETTINGS_TYPE_MOUSELOCK, IDS_WEBSITE_SETTINGS_TYPE_MOUSELOCK, |
102 IDR_BLOCKED_MOUSE_CURSOR, IDR_ALLOWED_MOUSE_CURSOR}, | 103 IDR_BLOCKED_MOUSE_CURSOR, IDR_ALLOWED_MOUSE_CURSOR}, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
220 ContentSetting setting, | 221 ContentSetting setting, |
221 ContentSetting default_setting, | 222 ContentSetting default_setting, |
222 content_settings::SettingSource source) { | 223 content_settings::SettingSource source) { |
223 ContentSetting effective_setting = setting; | 224 ContentSetting effective_setting = setting; |
224 if (effective_setting == CONTENT_SETTING_DEFAULT) | 225 if (effective_setting == CONTENT_SETTING_DEFAULT) |
225 effective_setting = default_setting; | 226 effective_setting = default_setting; |
226 | 227 |
227 #if defined(ENABLE_PLUGINS) | 228 #if defined(ENABLE_PLUGINS) |
228 effective_setting = | 229 effective_setting = |
229 PluginsFieldTrial::EffectiveContentSetting(type, effective_setting); | 230 PluginsFieldTrial::EffectiveContentSetting(type, effective_setting); |
231 | |
232 // Display the UI string for ASK instead of DETECT for HTML5 by Default. | |
233 // TODO(tommycli): Once HTML5 by Default is shipped and the feature flag | |
234 // is removed, just migrate the actual content setting to ASK. | |
235 if (base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins) && | |
236 effective_setting == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT) { | |
237 effective_setting = CONTENT_SETTING_ASK; | |
raymes
2016/09/05 06:56:31
I'm confused! In PluginsFieldTrial::EffectiveConte
tommycli
2016/09/13 16:29:28
It's unfortunate, but that's exactly what we want.
| |
238 } | |
230 #endif | 239 #endif |
231 | 240 |
232 const int* button_text_ids = NULL; | 241 const int* button_text_ids = NULL; |
233 switch (source) { | 242 switch (source) { |
234 case content_settings::SETTING_SOURCE_USER: | 243 case content_settings::SETTING_SOURCE_USER: |
235 if (setting == CONTENT_SETTING_DEFAULT) | 244 if (setting == CONTENT_SETTING_DEFAULT) |
236 button_text_ids = kPermissionButtonTextIDDefaultSetting; | 245 button_text_ids = kPermissionButtonTextIDDefaultSetting; |
237 else | 246 else |
238 button_text_ids = kPermissionButtonTextIDUserManaged; | 247 button_text_ids = kPermissionButtonTextIDUserManaged; |
239 break; | 248 break; |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 } | 373 } |
365 return resource_id; | 374 return resource_id; |
366 } | 375 } |
367 | 376 |
368 // static | 377 // static |
369 const gfx::Image& WebsiteSettingsUI::GetConnectionIcon( | 378 const gfx::Image& WebsiteSettingsUI::GetConnectionIcon( |
370 WebsiteSettings::SiteConnectionStatus status) { | 379 WebsiteSettings::SiteConnectionStatus status) { |
371 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 380 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
372 return rb.GetNativeImageNamed(GetConnectionIconID(status)); | 381 return rb.GetNativeImageNamed(GetConnectionIconID(status)); |
373 } | 382 } |
OLD | NEW |