| 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/page_info/page_info_ui.h" | 5 #include "chrome/browser/ui/page_info/page_info_ui.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 case content_settings::SETTING_SOURCE_POLICY: | 281 case content_settings::SETTING_SOURCE_POLICY: |
| 282 case content_settings::SETTING_SOURCE_EXTENSION: | 282 case content_settings::SETTING_SOURCE_EXTENSION: |
| 283 button_text_ids = kPermissionButtonTextIDUserManaged; | 283 button_text_ids = kPermissionButtonTextIDUserManaged; |
| 284 break; | 284 break; |
| 285 case content_settings::SETTING_SOURCE_WHITELIST: | 285 case content_settings::SETTING_SOURCE_WHITELIST: |
| 286 case content_settings::SETTING_SOURCE_NONE: | 286 case content_settings::SETTING_SOURCE_NONE: |
| 287 default: | 287 default: |
| 288 NOTREACHED(); | 288 NOTREACHED(); |
| 289 return base::string16(); | 289 return base::string16(); |
| 290 } | 290 } |
| 291 // The subresource filter permission uses the user managed strings |
| 292 // (i.e. Allow / Block). |
| 293 if (type == CONTENT_SETTINGS_TYPE_SUBRESOURCE_FILTER) |
| 294 button_text_ids = kPermissionButtonTextIDUserManaged; |
| 291 int button_text_id = button_text_ids[effective_setting]; | 295 int button_text_id = button_text_ids[effective_setting]; |
| 292 DCHECK_NE(button_text_id, kInvalidResourceID); | 296 DCHECK_NE(button_text_id, kInvalidResourceID); |
| 293 return l10n_util::GetStringUTF16(button_text_id); | 297 return l10n_util::GetStringUTF16(button_text_id); |
| 294 } | 298 } |
| 295 | 299 |
| 296 // static | 300 // static |
| 297 int PageInfoUI::GetPermissionIconID(ContentSettingsType type, | 301 int PageInfoUI::GetPermissionIconID(ContentSettingsType type, |
| 298 ContentSetting setting) { | 302 ContentSetting setting) { |
| 299 bool use_blocked = (setting == CONTENT_SETTING_BLOCK); | 303 bool use_blocked = (setting == CONTENT_SETTING_BLOCK); |
| 300 for (const PermissionsUIInfo& info : kPermissionsUIInfo) { | 304 for (const PermissionsUIInfo& info : kPermissionsUIInfo) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 const gfx::ImageSkia PageInfoUI::GetCertificateIcon() { | 442 const gfx::ImageSkia PageInfoUI::GetCertificateIcon() { |
| 439 return gfx::CreateVectorIcon(kCertificateIcon, 16, gfx::kChromeIconGrey); | 443 return gfx::CreateVectorIcon(kCertificateIcon, 16, gfx::kChromeIconGrey); |
| 440 } | 444 } |
| 441 #endif | 445 #endif |
| 442 | 446 |
| 443 // static | 447 // static |
| 444 bool PageInfoUI::ShouldShowCertificateLink() { | 448 bool PageInfoUI::ShouldShowCertificateLink() { |
| 445 return base::CommandLine::ForCurrentProcess()->HasSwitch( | 449 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 446 switches::kShowCertLink); | 450 switches::kShowCertLink); |
| 447 } | 451 } |
| OLD | NEW |