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

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

Issue 5564007: Update Content Settings Bubbles (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 10 years 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 | Annotate | Revision Log
OLDNEW
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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 manage_link; 71 std::string manage_link;
72 std::string clear_link;
73 std::string info_link; 72 std::string info_link;
74 std::string load_plugins_link_title; 73 bool info_link_enabled;
Peter Kasting 2010/12/07 17:53:00 Nit: I think "info_link" is too specific of a name
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) {}
90 virtual void OnManageLinkClicked() {} 88 virtual void OnManageLinkClicked() {}
91 virtual void OnClearLinkClicked() {}
92 virtual void OnInfoLinkClicked() {} 89 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 }
112 void set_manage_link(const std::string& link) { 108 void set_manage_link(const std::string& link) {
113 bubble_content_.manage_link = link; 109 bubble_content_.manage_link = link;
114 } 110 }
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) { 111 void set_info_link(const std::string& link) {
119 bubble_content_.info_link = link; 112 bubble_content_.info_link = link;
120 } 113 }
121 void set_load_plugins_link_title(const std::string& title) { 114 void set_info_link_enabled(bool enabled) {
122 bubble_content_.load_plugins_link_title = title; 115 bubble_content_.info_link_enabled = enabled;
123 }
124 void set_load_plugins_link_enabled(bool enabled) {
125 bubble_content_.load_plugins_link_enabled = enabled;
126 } 116 }
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/content_setting_bubble_model.cc » ('j') | chrome/browser/content_setting_bubble_model.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698