OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/content_setting_bubble_model.h" | 5 #include "chrome/browser/content_setting_bubble_model.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/blocked_content_container.h" | 9 #include "chrome/browser/blocked_content_container.h" |
10 #include "chrome/browser/content_settings/host_content_settings_map.h" | 10 #include "chrome/browser/content_settings/host_content_settings_map.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 0, // Notifications do not have a bubble. | 113 0, // Notifications do not have a bubble. |
114 0, // Prerender does not have a bubble. | 114 0, // Prerender does not have a bubble. |
115 }; | 115 }; |
116 COMPILE_ASSERT(arraysize(kLinkIDs) == CONTENT_SETTINGS_NUM_TYPES, | 116 COMPILE_ASSERT(arraysize(kLinkIDs) == CONTENT_SETTINGS_NUM_TYPES, |
117 Need_a_setting_for_every_content_settings_type); | 117 Need_a_setting_for_every_content_settings_type); |
118 set_manage_link(l10n_util::GetStringUTF8(kLinkIDs[content_type()])); | 118 set_manage_link(l10n_util::GetStringUTF8(kLinkIDs[content_type()])); |
119 } | 119 } |
120 | 120 |
121 virtual void OnManageLinkClicked() { | 121 virtual void OnManageLinkClicked() { |
122 if (tab_contents()) | 122 if (tab_contents()) |
123 tab_contents()->delegate()->ShowContentSettingsWindow(content_type()); | 123 tab_contents()->delegate()->ShowContentSettingsPage(content_type()); |
124 } | 124 } |
125 }; | 125 }; |
126 | 126 |
127 class ContentSettingTitleLinkAndCustomModel | 127 class ContentSettingTitleLinkAndCustomModel |
128 : public ContentSettingTitleAndLinkModel { | 128 : public ContentSettingTitleAndLinkModel { |
129 public: | 129 public: |
130 ContentSettingTitleLinkAndCustomModel(TabContents* tab_contents, | 130 ContentSettingTitleLinkAndCustomModel(TabContents* tab_contents, |
131 Profile* profile, | 131 Profile* profile, |
132 ContentSettingsType content_type) | 132 ContentSettingsType content_type) |
133 : ContentSettingTitleAndLinkModel(tab_contents, profile, content_type) { | 133 : ContentSettingTitleAndLinkModel(tab_contents, profile, content_type) { |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 bubble_content_.resource_identifiers.insert(resource_identifier); | 525 bubble_content_.resource_identifiers.insert(resource_identifier); |
526 } | 526 } |
527 | 527 |
528 void ContentSettingBubbleModel::Observe(NotificationType type, | 528 void ContentSettingBubbleModel::Observe(NotificationType type, |
529 const NotificationSource& source, | 529 const NotificationSource& source, |
530 const NotificationDetails& details) { | 530 const NotificationDetails& details) { |
531 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); | 531 DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); |
532 DCHECK(source == Source<TabContents>(tab_contents_)); | 532 DCHECK(source == Source<TabContents>(tab_contents_)); |
533 tab_contents_ = NULL; | 533 tab_contents_ = NULL; |
534 } | 534 } |
OLD | NEW |