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

Side by Side Diff: chrome/browser/ui/website_settings/website_settings_ui.h

Issue 2702923002: Page Info: Hide default permissions with a value of Ask if the default is Ask. (Closed)
Patch Set: Page Info: Add cross-platform logic to hide permissions with default values behind a button. Created 3 years, 10 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_WEBSITE_SETTINGS_WEBSITE_SETTINGS_UI_H_ 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_UI_H_
6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_UI_H_ 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_UI_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 25 matching lines...) Expand all
36 class WebsiteSettingsUI { 36 class WebsiteSettingsUI {
37 public: 37 public:
38 // The Website Settings UI contains several tabs. Each tab is associated with 38 // The Website Settings UI contains several tabs. Each tab is associated with
39 // a unique tab id. The enum |TabId| contains all the ids for the tabs. 39 // a unique tab id. The enum |TabId| contains all the ids for the tabs.
40 enum TabId { 40 enum TabId {
41 TAB_ID_PERMISSIONS = 0, 41 TAB_ID_PERMISSIONS = 0,
42 TAB_ID_CONNECTION, 42 TAB_ID_CONNECTION,
43 NUM_TAB_IDS, 43 NUM_TAB_IDS,
44 }; 44 };
45 45
46 // A value that represents a what subset of permissions are shown. Thisis used
palmer 2017/02/24 01:55:02 Typo: "This is"
lgarron 2017/02/24 02:15:27 Fixed.
47 // to determine the behaviour of the permission button.
48 enum VisiblePermissions {
49 VISIBLE_PERMISSIONS_NONE,
50 VISIBLE_PERMISSIONS_SOME_BUT_NOT_ALL,
51 VISIBLE_PERMISSIONS_ALL,
52 };
53
46 // The security summary is styled depending on the security state. At the 54 // The security summary is styled depending on the security state. At the
47 // moment, the only styling we apply is color, but it could also include e.g. 55 // moment, the only styling we apply is color, but it could also include e.g.
48 // bolding. 56 // bolding.
49 enum SecuritySummaryStyle { STYLE_UNSTYLED = 0, STYLE_COLOR = 1 << 1 }; 57 enum SecuritySummaryStyle { STYLE_UNSTYLED = 0, STYLE_COLOR = 1 << 1 };
50 58
51 struct SecurityDescription { 59 struct SecurityDescription {
52 // A one-line summary of the security state. 60 // A one-line summary of the security state.
53 base::string16 summary; 61 base::string16 summary;
54 // A short paragraph with more details about the state, and how 62 // A short paragraph with more details about the state, and how
55 // the user should treat it. 63 // the user should treat it.
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // Returns the UI string describing the action taken for a permission, 156 // Returns the UI string describing the action taken for a permission,
149 // including why that action was taken. E.g. "Allowed by you", 157 // including why that action was taken. E.g. "Allowed by you",
150 // "Blocked by default". 158 // "Blocked by default".
151 static base::string16 PermissionActionToUIString( 159 static base::string16 PermissionActionToUIString(
152 Profile* profile, 160 Profile* profile,
153 ContentSettingsType type, 161 ContentSettingsType type,
154 ContentSetting setting, 162 ContentSetting setting,
155 ContentSetting default_setting, 163 ContentSetting default_setting,
156 content_settings::SettingSource source); 164 content_settings::SettingSource source);
157 165
166 // Returns the UI string for the given permission |type|.
167 static base::string16 GetPermissionButtonString(
168 VisiblePermissions visible_permissions);
169
158 // Returns the icon resource ID for the given permission |type| and |setting|. 170 // Returns the icon resource ID for the given permission |type| and |setting|.
159 static int GetPermissionIconID(ContentSettingsType type, 171 static int GetPermissionIconID(ContentSettingsType type,
160 ContentSetting setting); 172 ContentSetting setting);
161 173
162 // Returns the icon for the given permissionInfo |info|. If |info|'s current 174 // Returns the icon for the given permissionInfo |info|. If |info|'s current
163 // setting is CONTENT_SETTING_DEFAULT, it will return the icon for |info|'s 175 // setting is CONTENT_SETTING_DEFAULT, it will return the icon for |info|'s
164 // default setting. 176 // default setting.
165 static const gfx::Image& GetPermissionIcon(const PermissionInfo& info); 177 static const gfx::Image& GetPermissionIcon(const PermissionInfo& info);
166 178
167 // Returns the UI string describing the given object |info|. 179 // Returns the UI string describing the given object |info|.
(...skipping 19 matching lines...) Expand all
187 WebsiteSettings::SiteConnectionStatus status); 199 WebsiteSettings::SiteConnectionStatus status);
188 200
189 // Sets cookie information. 201 // Sets cookie information.
190 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) = 0; 202 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) = 0;
191 203
192 // Sets permission information. 204 // Sets permission information.
193 virtual void SetPermissionInfo( 205 virtual void SetPermissionInfo(
194 const PermissionInfoList& permission_info_list, 206 const PermissionInfoList& permission_info_list,
195 ChosenObjectInfoList chosen_object_info_list) = 0; 207 ChosenObjectInfoList chosen_object_info_list) = 0;
196 208
209 // Sets permission button
210 virtual void UpdatePermissionButton(
211 VisiblePermissions visible_permissions) = 0;
212
197 // Sets site identity information. 213 // Sets site identity information.
198 virtual void SetIdentityInfo(const IdentityInfo& identity_info) = 0; 214 virtual void SetIdentityInfo(const IdentityInfo& identity_info) = 0;
199 }; 215 };
200 216
201 typedef WebsiteSettingsUI::CookieInfoList CookieInfoList; 217 typedef WebsiteSettingsUI::CookieInfoList CookieInfoList;
202 typedef WebsiteSettingsUI::PermissionInfoList PermissionInfoList; 218 typedef WebsiteSettingsUI::PermissionInfoList PermissionInfoList;
203 typedef WebsiteSettingsUI::ChosenObjectInfoList ChosenObjectInfoList; 219 typedef WebsiteSettingsUI::ChosenObjectInfoList ChosenObjectInfoList;
204 220
205 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_UI_H_ 221 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_UI_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698