OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_CONTENT_SETTING_BUBBLE_MODEL_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTING_BUBBLE_MODEL_H_ |
6 #define CHROME_BROWSER_CONTENT_SETTING_BUBBLE_MODEL_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTING_BUBBLE_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 | 61 |
62 struct BubbleContent { | 62 struct BubbleContent { |
63 BubbleContent(); | 63 BubbleContent(); |
64 ~BubbleContent(); | 64 ~BubbleContent(); |
65 | 65 |
66 std::string title; | 66 std::string title; |
67 PopupItems popup_items; | 67 PopupItems popup_items; |
68 RadioGroup radio_group; | 68 RadioGroup radio_group; |
69 std::vector<DomainList> domain_lists; | 69 std::vector<DomainList> domain_lists; |
70 std::set<std::string> resource_identifiers; | 70 std::set<std::string> resource_identifiers; |
| 71 std::string custom_link; |
| 72 bool custom_link_enabled; |
71 std::string manage_link; | 73 std::string manage_link; |
72 std::string clear_link; | |
73 std::string info_link; | |
74 std::string load_plugins_link_title; | |
75 bool load_plugins_link_enabled; | |
76 | 74 |
77 private: | 75 private: |
78 DISALLOW_COPY_AND_ASSIGN(BubbleContent); | 76 DISALLOW_COPY_AND_ASSIGN(BubbleContent); |
79 }; | 77 }; |
80 | 78 |
81 const BubbleContent& bubble_content() const { return bubble_content_; } | 79 const BubbleContent& bubble_content() const { return bubble_content_; } |
82 | 80 |
83 // NotificationObserver: | 81 // NotificationObserver: |
84 virtual void Observe(NotificationType type, | 82 virtual void Observe(NotificationType type, |
85 const NotificationSource& source, | 83 const NotificationSource& source, |
86 const NotificationDetails& details); | 84 const NotificationDetails& details); |
87 | 85 |
88 virtual void OnRadioClicked(int radio_index) {} | 86 virtual void OnRadioClicked(int radio_index) {} |
89 virtual void OnPopupClicked(int index) {} | 87 virtual void OnPopupClicked(int index) {} |
| 88 virtual void OnCustomLinkClicked() {} |
90 virtual void OnManageLinkClicked() {} | 89 virtual void OnManageLinkClicked() {} |
91 virtual void OnClearLinkClicked() {} | |
92 virtual void OnInfoLinkClicked() {} | |
93 virtual void OnLoadPluginsLinkClicked() {} | |
94 | 90 |
95 protected: | 91 protected: |
96 ContentSettingBubbleModel(TabContents* tab_contents, Profile* profile, | 92 ContentSettingBubbleModel(TabContents* tab_contents, Profile* profile, |
97 ContentSettingsType content_type); | 93 ContentSettingsType content_type); |
98 | 94 |
99 TabContents* tab_contents() const { return tab_contents_; } | 95 TabContents* tab_contents() const { return tab_contents_; } |
100 Profile* profile() const { return profile_; } | 96 Profile* profile() const { return profile_; } |
101 | 97 |
102 void set_title(const std::string& title) { bubble_content_.title = title; } | 98 void set_title(const std::string& title) { bubble_content_.title = title; } |
103 void add_popup(const PopupItem& popup) { | 99 void add_popup(const PopupItem& popup) { |
104 bubble_content_.popup_items.push_back(popup); | 100 bubble_content_.popup_items.push_back(popup); |
105 } | 101 } |
106 void set_radio_group(const RadioGroup& radio_group) { | 102 void set_radio_group(const RadioGroup& radio_group) { |
107 bubble_content_.radio_group = radio_group; | 103 bubble_content_.radio_group = radio_group; |
108 } | 104 } |
109 void add_domain_list(const DomainList& domain_list) { | 105 void add_domain_list(const DomainList& domain_list) { |
110 bubble_content_.domain_lists.push_back(domain_list); | 106 bubble_content_.domain_lists.push_back(domain_list); |
111 } | 107 } |
| 108 void set_custom_link(const std::string& link) { |
| 109 bubble_content_.custom_link = link; |
| 110 } |
| 111 void set_custom_link_enabled(bool enabled) { |
| 112 bubble_content_.custom_link_enabled = enabled; |
| 113 } |
112 void set_manage_link(const std::string& link) { | 114 void set_manage_link(const std::string& link) { |
113 bubble_content_.manage_link = link; | 115 bubble_content_.manage_link = link; |
114 } | 116 } |
115 void set_clear_link(const std::string& link) { | |
116 bubble_content_.clear_link = link; | |
117 } | |
118 void set_info_link(const std::string& link) { | |
119 bubble_content_.info_link = link; | |
120 } | |
121 void set_load_plugins_link_title(const std::string& title) { | |
122 bubble_content_.load_plugins_link_title = title; | |
123 } | |
124 void set_load_plugins_link_enabled(bool enabled) { | |
125 bubble_content_.load_plugins_link_enabled = enabled; | |
126 } | |
127 void AddBlockedResource(const std::string& resource_identifier); | 117 void AddBlockedResource(const std::string& resource_identifier); |
128 | 118 |
129 private: | 119 private: |
130 TabContents* tab_contents_; | 120 TabContents* tab_contents_; |
131 Profile* profile_; | 121 Profile* profile_; |
132 ContentSettingsType content_type_; | 122 ContentSettingsType content_type_; |
133 BubbleContent bubble_content_; | 123 BubbleContent bubble_content_; |
134 // A registrar for listening for TAB_CONTENTS_DESTROYED notifications. | 124 // A registrar for listening for TAB_CONTENTS_DESTROYED notifications. |
135 NotificationRegistrar registrar_; | 125 NotificationRegistrar registrar_; |
136 }; | 126 }; |
137 | 127 |
138 #endif // CHROME_BROWSER_CONTENT_SETTING_BUBBLE_MODEL_H_ | 128 #endif // CHROME_BROWSER_CONTENT_SETTING_BUBBLE_MODEL_H_ |
OLD | NEW |