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 #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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 std::string title; | 111 std::string title; |
112 ListItems list_items; | 112 ListItems list_items; |
113 RadioGroup radio_group; | 113 RadioGroup radio_group; |
114 bool radio_group_enabled; | 114 bool radio_group_enabled; |
115 std::vector<DomainList> domain_lists; | 115 std::vector<DomainList> domain_lists; |
116 std::string custom_link; | 116 std::string custom_link; |
117 bool custom_link_enabled; | 117 bool custom_link_enabled; |
118 std::string manage_link; | 118 std::string manage_link; |
119 MediaMenuMap media_menus; | 119 MediaMenuMap media_menus; |
120 std::string learn_more_link; | 120 std::string learn_more_link; |
121 std::string message; | |
msw
2016/08/10 17:30:54
nit: order directly after title?
melandory
2016/08/13 07:06:22
Done.
| |
121 | 122 |
122 private: | 123 private: |
123 DISALLOW_COPY_AND_ASSIGN(BubbleContent); | 124 DISALLOW_COPY_AND_ASSIGN(BubbleContent); |
124 }; | 125 }; |
125 | 126 |
126 // Creates a bubble model for a particular |content_type|. Note that not all | 127 // Creates a bubble model for a particular |content_type|. Note that not all |
127 // bubbles fit this description. | 128 // bubbles fit this description. |
128 // TODO(msramek): Move this to ContentSettingSimpleBubbleModel or remove | 129 // TODO(msramek): Move this to ContentSettingSimpleBubbleModel or remove |
129 // entirely. | 130 // entirely. |
130 static ContentSettingBubbleModel* CreateContentSettingBubbleModel( | 131 static ContentSettingBubbleModel* CreateContentSettingBubbleModel( |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 protected: | 173 protected: |
173 ContentSettingBubbleModel( | 174 ContentSettingBubbleModel( |
174 Delegate* delegate, | 175 Delegate* delegate, |
175 content::WebContents* web_contents, | 176 content::WebContents* web_contents, |
176 Profile* profile); | 177 Profile* profile); |
177 | 178 |
178 content::WebContents* web_contents() const { return web_contents_; } | 179 content::WebContents* web_contents() const { return web_contents_; } |
179 Profile* profile() const { return profile_; } | 180 Profile* profile() const { return profile_; } |
180 Delegate* delegate() const { return delegate_; } | 181 Delegate* delegate() const { return delegate_; } |
181 | 182 |
183 void set_message(const std::string& message) { | |
msw
2016/08/10 17:30:54
nit: match accessor ordering to member decl orderi
melandory
2016/08/13 07:06:22
Done.
| |
184 bubble_content_.message = message; | |
185 } | |
182 void set_title(const std::string& title) { bubble_content_.title = title; } | 186 void set_title(const std::string& title) { bubble_content_.title = title; } |
183 void add_list_item(const ListItem& item) { | 187 void add_list_item(const ListItem& item) { |
184 bubble_content_.list_items.push_back(item); | 188 bubble_content_.list_items.push_back(item); |
185 } | 189 } |
186 void set_radio_group(const RadioGroup& radio_group) { | 190 void set_radio_group(const RadioGroup& radio_group) { |
187 bubble_content_.radio_group = radio_group; | 191 bubble_content_.radio_group = radio_group; |
188 } | 192 } |
189 void set_radio_group_enabled(bool enabled) { | 193 void set_radio_group_enabled(bool enabled) { |
190 bubble_content_.radio_group_enabled = enabled; | 194 bubble_content_.radio_group_enabled = enabled; |
191 } | 195 } |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
297 content::WebContents* web_contents, | 301 content::WebContents* web_contents, |
298 Profile* profile); | 302 Profile* profile); |
299 | 303 |
300 ~ContentSettingSubresourceFilterBubbleModel() override; | 304 ~ContentSettingSubresourceFilterBubbleModel() override; |
301 | 305 |
302 void OnManageLinkClicked() override; | 306 void OnManageLinkClicked() override; |
303 ContentSettingSubresourceFilterBubbleModel* AsSubresourceFilterBubbleModel() | 307 ContentSettingSubresourceFilterBubbleModel* AsSubresourceFilterBubbleModel() |
304 override; | 308 override; |
305 | 309 |
306 private: | 310 private: |
311 void SetMessage(); | |
312 | |
307 // ContentSettingBubbleModel: | 313 // ContentSettingBubbleModel: |
308 void SetTitle() override; | 314 void SetTitle() override; |
309 void SetManageLink() override; | 315 void SetManageLink() override; |
310 | 316 |
311 DISALLOW_COPY_AND_ASSIGN(ContentSettingSubresourceFilterBubbleModel); | 317 DISALLOW_COPY_AND_ASSIGN(ContentSettingSubresourceFilterBubbleModel); |
312 }; | 318 }; |
313 | 319 |
314 // The model of the content settings bubble for media settings. | 320 // The model of the content settings bubble for media settings. |
315 class ContentSettingMediaStreamBubbleModel : public ContentSettingBubbleModel { | 321 class ContentSettingMediaStreamBubbleModel : public ContentSettingBubbleModel { |
316 public: | 322 public: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
361 // The content settings that are associated with the individual radio | 367 // The content settings that are associated with the individual radio |
362 // buttons. | 368 // buttons. |
363 ContentSetting radio_item_setting_[2]; | 369 ContentSetting radio_item_setting_[2]; |
364 // The state of the microphone and camera access. | 370 // The state of the microphone and camera access. |
365 TabSpecificContentSettings::MicrophoneCameraState state_; | 371 TabSpecificContentSettings::MicrophoneCameraState state_; |
366 | 372 |
367 DISALLOW_COPY_AND_ASSIGN(ContentSettingMediaStreamBubbleModel); | 373 DISALLOW_COPY_AND_ASSIGN(ContentSettingMediaStreamBubbleModel); |
368 }; | 374 }; |
369 | 375 |
370 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ | 376 #endif // CHROME_BROWSER_UI_CONTENT_SETTINGS_CONTENT_SETTING_BUBBLE_MODEL_H_ |
OLD | NEW |