Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(646)

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.h

Issue 319553008: Updated Plugin bubble model to add "learn more" link and to appear with a sliding yellow thing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated so that the yellow thing occurs only when the content setting is set to allow Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ 5 #ifndef CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_
6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ 6 #define CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_
7 7
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 80
81 std::string title; 81 std::string title;
82 PopupItems popup_items; 82 PopupItems popup_items;
83 RadioGroup radio_group; 83 RadioGroup radio_group;
84 bool radio_group_enabled; 84 bool radio_group_enabled;
85 std::vector<DomainList> domain_lists; 85 std::vector<DomainList> domain_lists;
86 std::string custom_link; 86 std::string custom_link;
87 bool custom_link_enabled; 87 bool custom_link_enabled;
88 std::string manage_link; 88 std::string manage_link;
89 MediaMenuMap media_menus; 89 MediaMenuMap media_menus;
90 std::string learn_more_link;
90 91
91 private: 92 private:
92 DISALLOW_COPY_AND_ASSIGN(BubbleContent); 93 DISALLOW_COPY_AND_ASSIGN(BubbleContent);
93 }; 94 };
94 95
95 static ContentSettingBubbleModel* CreateContentSettingBubbleModel( 96 static ContentSettingBubbleModel* CreateContentSettingBubbleModel(
96 Delegate* delegate, 97 Delegate* delegate,
97 content::WebContents* web_contents, 98 content::WebContents* web_contents,
98 Profile* profile, 99 Profile* profile,
99 ContentSettingsType content_type); 100 ContentSettingsType content_type);
100 101
101 virtual ~ContentSettingBubbleModel(); 102 virtual ~ContentSettingBubbleModel();
102 103
103 ContentSettingsType content_type() const { return content_type_; } 104 ContentSettingsType content_type() const { return content_type_; }
104 105
105 const BubbleContent& bubble_content() const { return bubble_content_; } 106 const BubbleContent& bubble_content() const { return bubble_content_; }
106 107
107 // content::NotificationObserver: 108 // content::NotificationObserver:
108 virtual void Observe(int type, 109 virtual void Observe(int type,
109 const content::NotificationSource& source, 110 const content::NotificationSource& source,
110 const content::NotificationDetails& details) OVERRIDE; 111 const content::NotificationDetails& details) OVERRIDE;
111 112
112 virtual void OnRadioClicked(int radio_index) {} 113 virtual void OnRadioClicked(int radio_index) {}
113 virtual void OnPopupClicked(int index) {} 114 virtual void OnPopupClicked(int index) {}
114 virtual void OnCustomLinkClicked() {} 115 virtual void OnCustomLinkClicked() {}
115 virtual void OnManageLinkClicked() {} 116 virtual void OnManageLinkClicked() {}
117 virtual void OnLearnMoreLinkClicked() {}
116 virtual void OnMediaMenuClicked(content::MediaStreamType type, 118 virtual void OnMediaMenuClicked(content::MediaStreamType type,
117 const std::string& selected_device_id) {} 119 const std::string& selected_device_id) {}
118 120
119 // Called by the view code when the bubble is closed by the user using the 121 // Called by the view code when the bubble is closed by the user using the
120 // Done button. 122 // Done button.
121 virtual void OnDoneClicked() {} 123 virtual void OnDoneClicked() {}
122 124
123 protected: 125 protected:
124 ContentSettingBubbleModel( 126 ContentSettingBubbleModel(
125 content::WebContents* web_contents, 127 content::WebContents* web_contents,
(...skipping 18 matching lines...) Expand all
144 } 146 }
145 void set_custom_link(const std::string& link) { 147 void set_custom_link(const std::string& link) {
146 bubble_content_.custom_link = link; 148 bubble_content_.custom_link = link;
147 } 149 }
148 void set_custom_link_enabled(bool enabled) { 150 void set_custom_link_enabled(bool enabled) {
149 bubble_content_.custom_link_enabled = enabled; 151 bubble_content_.custom_link_enabled = enabled;
150 } 152 }
151 void set_manage_link(const std::string& link) { 153 void set_manage_link(const std::string& link) {
152 bubble_content_.manage_link = link; 154 bubble_content_.manage_link = link;
153 } 155 }
156 void set_learn_more_link(const std::string& link) {
157 bubble_content_.learn_more_link = link;
158 }
154 void add_media_menu(content::MediaStreamType type, const MediaMenu& menu) { 159 void add_media_menu(content::MediaStreamType type, const MediaMenu& menu) {
155 bubble_content_.media_menus[type] = menu; 160 bubble_content_.media_menus[type] = menu;
156 } 161 }
157 void set_selected_device(const content::MediaStreamDevice& device) { 162 void set_selected_device(const content::MediaStreamDevice& device) {
158 bubble_content_.media_menus[device.type].selected_device = device; 163 bubble_content_.media_menus[device.type].selected_device = device;
159 } 164 }
160 bool setting_is_managed() { 165 bool setting_is_managed() {
161 return setting_is_managed_; 166 return setting_is_managed_;
162 } 167 }
163 void set_setting_is_managed(bool managed) { 168 void set_setting_is_managed(bool managed) {
(...skipping 19 matching lines...) Expand all
183 ContentSettingTitleAndLinkModel(Delegate* delegate, 188 ContentSettingTitleAndLinkModel(Delegate* delegate,
184 content::WebContents* web_contents, 189 content::WebContents* web_contents,
185 Profile* profile, 190 Profile* profile,
186 ContentSettingsType content_type); 191 ContentSettingsType content_type);
187 virtual ~ContentSettingTitleAndLinkModel() {} 192 virtual ~ContentSettingTitleAndLinkModel() {}
188 Delegate* delegate() const { return delegate_; } 193 Delegate* delegate() const { return delegate_; }
189 194
190 private: 195 private:
191 void SetTitle(); 196 void SetTitle();
192 void SetManageLink(); 197 void SetManageLink();
198 void SetLearnMoreLink();
199
200 // content::ContentSettingBubbleModel:
193 virtual void OnManageLinkClicked() OVERRIDE; 201 virtual void OnManageLinkClicked() OVERRIDE;
194 202 virtual void OnLearnMoreLinkClicked() OVERRIDE;
195 Delegate* delegate_; 203 Delegate* delegate_;
196 }; 204 };
197 205
198 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel { 206 class ContentSettingRPHBubbleModel : public ContentSettingTitleAndLinkModel {
199 public: 207 public:
200 ContentSettingRPHBubbleModel(Delegate* delegate, 208 ContentSettingRPHBubbleModel(Delegate* delegate,
201 content::WebContents* web_contents, 209 content::WebContents* web_contents,
202 Profile* profile, 210 Profile* profile,
203 ProtocolHandlerRegistry* registry, 211 ProtocolHandlerRegistry* registry,
204 ContentSettingsType content_type); 212 ContentSettingsType content_type);
(...skipping 15 matching lines...) Expand all
220 void IgnoreProtocolHandler(); 228 void IgnoreProtocolHandler();
221 void ClearOrSetPreviousHandler(); 229 void ClearOrSetPreviousHandler();
222 230
223 int selected_item_; 231 int selected_item_;
224 ProtocolHandlerRegistry* registry_; 232 ProtocolHandlerRegistry* registry_;
225 ProtocolHandler pending_handler_; 233 ProtocolHandler pending_handler_;
226 ProtocolHandler previous_handler_; 234 ProtocolHandler previous_handler_;
227 }; 235 };
228 236
229 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ 237 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698