Chromium Code Reviews| Index: chrome/browser/content_setting_bubble_model.cc |
| diff --git a/chrome/browser/content_setting_bubble_model.cc b/chrome/browser/content_setting_bubble_model.cc |
| index 68c9800c4de2e4538f05cbfd3586c22cfc1f0a6e..d79578e0a88d053a1ee5b56bf7ac87cec157af36 100644 |
| --- a/chrome/browser/content_setting_bubble_model.cc |
| +++ b/chrome/browser/content_setting_bubble_model.cc |
| @@ -134,9 +134,9 @@ class ContentSettingTitleLinkAndInfoModel |
| IDS_BLOCKED_COOKIES_INFO, |
| 0, // Images do not have an info link. |
| 0, // Javascript doesn't have an info link. |
| - 0, // Plugins do not have an info link. |
| + IDS_BLOCKED_PLUGINS_LOAD_ALL, |
| 0, // Popups do not have an info link. |
| - 0, // Geolocation does not have an info link. |
| + 0, // Geolocation links are set within that class. |
| 0, // Notifications do not have a bubble. |
| }; |
| COMPILE_ASSERT(arraysize(kInfoIDs) == CONTENT_SETTINGS_NUM_TYPES, |
| @@ -159,11 +159,14 @@ class ContentSettingTitleLinkAndInfoModel |
| }; |
| -class ContentSettingSingleRadioGroup : public ContentSettingTitleAndLinkModel { |
| +class ContentSettingSingleRadioGroup |
| + : public ContentSettingTitleLinkAndInfoModel { |
| public: |
| ContentSettingSingleRadioGroup(TabContents* tab_contents, Profile* profile, |
| ContentSettingsType content_type) |
| - : ContentSettingTitleAndLinkModel(tab_contents, profile, content_type), |
| + : ContentSettingTitleLinkAndInfoModel(tab_contents, |
| + profile, |
| + content_type), |
| block_setting_(CONTENT_SETTING_BLOCK) { |
| SetRadioGroup(); |
| } |
| @@ -292,21 +295,15 @@ class ContentSettingPluginBubbleModel : public ContentSettingSingleRadioGroup { |
| ContentSettingsType content_type) |
| : ContentSettingSingleRadioGroup(tab_contents, profile, content_type) { |
| DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_PLUGINS); |
| - SetLoadPluginsLinkTitle(); |
| } |
| private: |
| - void SetLoadPluginsLinkTitle() { |
| - set_load_plugins_link_title( |
| - l10n_util::GetStringUTF8(IDS_BLOCKED_PLUGINS_LOAD_ALL)); |
| - } |
| - |
| - virtual void OnLoadPluginsLinkClicked() { |
| + virtual void OnInfoLinkClicked() OVERRIDE { |
| UserMetrics::RecordAction(UserMetricsAction("ClickToPlay_LoadAll_Bubble")); |
| if (tab_contents()) { |
| tab_contents()->render_view_host()->LoadBlockedPlugins(); |
| } |
| - set_load_plugins_link_enabled(false); |
| + set_info_link_enabled(false); |
| TabSpecificContentSettings* settings = |
| tab_contents()->GetTabSpecificContentSettings(); |
| settings->set_load_plugins_link_enabled(false); |
|
msw
2010/12/07 03:28:58
If we want, I can rename TabSpecificContentSetting
Peter Kasting
2010/12/07 17:53:00
No, I think that'd be wrong. From that class' per
|
| @@ -350,6 +347,7 @@ class ContentSettingPopupBubbleModel : public ContentSettingSingleRadioGroup { |
| bubble_content().popup_items[index].tab_contents); |
| } |
| } |
| + virtual void OnInfoLinkClicked() OVERRIDE {} |
| }; |
| class ContentSettingDomainListBubbleModel |
| @@ -361,7 +359,7 @@ class ContentSettingDomainListBubbleModel |
| : ContentSettingTitleAndLinkModel(tab_contents, profile, content_type) { |
| DCHECK_EQ(CONTENT_SETTINGS_TYPE_GEOLOCATION, content_type) << |
| "SetDomains currently only supports geolocation content type"; |
| - SetDomainsAndClearLink(); |
| + SetDomainsAndInfoLink(); |
| } |
| private: |
| @@ -373,7 +371,7 @@ class ContentSettingDomainListBubbleModel |
| add_domain_list(domain_list); |
| } |
| } |
| - void SetDomainsAndClearLink() { |
| + void SetDomainsAndInfoLink() { |
| TabSpecificContentSettings* content_settings = |
| tab_contents()->GetTabSpecificContentSettings(); |
| const GeolocationSettingsState& settings = |
| @@ -390,21 +388,20 @@ class ContentSettingDomainListBubbleModel |
| IDS_GEOLOCATION_BUBBLE_SECTION_DENIED); |
| if (tab_state_flags & GeolocationSettingsState::TABSTATE_HAS_EXCEPTION) { |
| - set_clear_link( |
| - l10n_util::GetStringUTF8(IDS_GEOLOCATION_BUBBLE_CLEAR_LINK)); |
| + set_info_link(l10n_util::GetStringUTF8( |
| + IDS_GEOLOCATION_BUBBLE_CLEAR_LINK)); |
| + set_info_link_enabled(true); |
| } else if (tab_state_flags & |
| GeolocationSettingsState::TABSTATE_HAS_CHANGED) { |
| - // It is a slight abuse of the domain list field to use it for the reload |
| - // hint, but works fine for now. TODO(joth): If we need to style it |
| - // differently, consider adding an explicit field, or generalize the |
| - // domain list to be a flat list of style formatted lines. |
| - DomainList reload_section; |
| - reload_section.title = l10n_util::GetStringUTF8( |
| - IDS_GEOLOCATION_BUBBLE_REQUIRE_RELOAD_TO_CLEAR); |
| - add_domain_list(reload_section); |
| + set_info_link(l10n_util::GetStringUTF8( |
| + IDS_GEOLOCATION_BUBBLE_REQUIRE_RELOAD_TO_CLEAR)); |
| + set_info_link_enabled(false); |
| + } else { |
| + set_info_link(std::string()); |
| + set_info_link_enabled(false); |
| } |
| } |
| - virtual void OnClearLinkClicked() { |
| + virtual void OnInfoLinkClicked() OVERRIDE { |
| if (!tab_contents()) |
| return; |
| // Reset this embedder's entry to default for each of the requesting |
| @@ -458,9 +455,9 @@ ContentSettingBubbleModel::ContentSettingBubbleModel( |
| if (tab_contents) { |
| TabSpecificContentSettings* settings = |
| tab_contents->GetTabSpecificContentSettings(); |
| - set_load_plugins_link_enabled(settings->load_plugins_link_enabled()); |
| + set_info_link_enabled(settings->load_plugins_link_enabled()); |
| } else { |
| - set_load_plugins_link_enabled(true); |
| + set_info_link_enabled(true); |
| } |
| registrar_.Add(this, NotificationType::TAB_CONTENTS_DESTROYED, |
| Source<TabContents>(tab_contents)); |
| @@ -478,7 +475,7 @@ ContentSettingBubbleModel::DomainList::DomainList() {} |
| ContentSettingBubbleModel::DomainList::~DomainList() {} |
| ContentSettingBubbleModel::BubbleContent::BubbleContent() |
| - : load_plugins_link_enabled(false) { |
| + : info_link_enabled(false) { |
| } |
| ContentSettingBubbleModel::BubbleContent::~BubbleContent() {} |