| 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 "chrome/grit/chromium_strings.h" | 7 #include "chrome/grit/chromium_strings.h" |
| 8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 } | 156 } |
| 157 | 157 |
| 158 // static | 158 // static |
| 159 base::string16 WebsiteSettingsUI::PermissionActionToUIString( | 159 base::string16 WebsiteSettingsUI::PermissionActionToUIString( |
| 160 ContentSettingsType type, | 160 ContentSettingsType type, |
| 161 ContentSetting setting, | 161 ContentSetting setting, |
| 162 ContentSetting default_setting, | 162 ContentSetting default_setting, |
| 163 content_settings::SettingSource source) { | 163 content_settings::SettingSource source) { |
| 164 ContentSetting effective_setting = setting; | 164 ContentSetting effective_setting = setting; |
| 165 if (effective_setting == CONTENT_SETTING_DEFAULT) { | 165 if (effective_setting == CONTENT_SETTING_DEFAULT) |
| 166 effective_setting = default_setting; | 166 effective_setting = default_setting; |
| 167 | 167 |
| 168 // For Plugins, ASK is obsolete. Show as BLOCK to reflect actual behavior. | |
| 169 if (type == CONTENT_SETTINGS_TYPE_PLUGINS && | |
| 170 default_setting == CONTENT_SETTING_ASK) { | |
| 171 effective_setting = CONTENT_SETTING_BLOCK; | |
| 172 } | |
| 173 } | |
| 174 | |
| 175 const int* button_text_ids = NULL; | 168 const int* button_text_ids = NULL; |
| 176 switch (source) { | 169 switch (source) { |
| 177 case content_settings::SETTING_SOURCE_USER: | 170 case content_settings::SETTING_SOURCE_USER: |
| 178 if (setting == CONTENT_SETTING_DEFAULT) | 171 if (setting == CONTENT_SETTING_DEFAULT) |
| 179 button_text_ids = kPermissionButtonTextIDDefaultSetting; | 172 button_text_ids = kPermissionButtonTextIDDefaultSetting; |
| 180 else | 173 else |
| 181 button_text_ids = kPermissionButtonTextIDUserManaged; | 174 button_text_ids = kPermissionButtonTextIDUserManaged; |
| 182 break; | 175 break; |
| 183 case content_settings::SETTING_SOURCE_POLICY: | 176 case content_settings::SETTING_SOURCE_POLICY: |
| 184 button_text_ids = kPermissionButtonTextIDPolicyManaged; | 177 button_text_ids = kPermissionButtonTextIDPolicyManaged; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // the first time. | 335 // the first time. |
| 343 return IDR_PAGEINFO_INFO; | 336 return IDR_PAGEINFO_INFO; |
| 344 } | 337 } |
| 345 | 338 |
| 346 // static | 339 // static |
| 347 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon( | 340 const gfx::Image& WebsiteSettingsUI::GetFirstVisitIcon( |
| 348 const base::string16& first_visit) { | 341 const base::string16& first_visit) { |
| 349 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 342 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 350 return rb.GetNativeImageNamed(GetFirstVisitIconID(first_visit)); | 343 return rb.GetNativeImageNamed(GetFirstVisitIconID(first_visit)); |
| 351 } | 344 } |
| OLD | NEW |