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

Side by Side Diff: chrome/browser/ui/page_info/page_info_ui.h

Issue 2743423004: Permissions: Show the reason for permission decisions made on the user's behalf. (Closed)
Patch Set: Review comments. Created 3 years, 8 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_PAGE_INFO_PAGE_INFO_UI_H_ 5 #ifndef CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_UI_H_
6 #define CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_UI_H_ 6 #define CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_UI_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/strings/string16.h" 12 #include "base/strings/string16.h"
13 #include "chrome/browser/ui/page_info/page_info.h" 13 #include "chrome/browser/ui/page_info/page_info.h"
14 #include "components/content_settings/core/common/content_settings.h" 14 #include "components/content_settings/core/common/content_settings.h"
15 #include "components/content_settings/core/common/content_settings_types.h" 15 #include "components/content_settings/core/common/content_settings_types.h"
16 #include "ui/gfx/native_widget_types.h" 16 #include "ui/gfx/native_widget_types.h"
17 17
18 class GURL;
18 class Profile; 19 class Profile;
19 class PageInfo; 20 class PageInfo;
20 21
21 namespace gfx { 22 namespace gfx {
22 class Image; 23 class Image;
23 } 24 }
24 25
25 namespace net { 26 namespace net {
26 class X509Certificate; 27 class X509Certificate;
27 } 28 }
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 // including why that action was taken. E.g. "Allowed by you", 149 // including why that action was taken. E.g. "Allowed by you",
149 // "Blocked by default". If |setting| is default, specify the actual default 150 // "Blocked by default". If |setting| is default, specify the actual default
150 // setting using |default_setting|. 151 // setting using |default_setting|.
151 static base::string16 PermissionActionToUIString( 152 static base::string16 PermissionActionToUIString(
152 Profile* profile, 153 Profile* profile,
153 ContentSettingsType type, 154 ContentSettingsType type,
154 ContentSetting setting, 155 ContentSetting setting,
155 ContentSetting default_setting, 156 ContentSetting default_setting,
156 content_settings::SettingSource source); 157 content_settings::SettingSource source);
157 158
159 // Returns a string indicating whether the permission was blocked via an
160 // extension, enterprise policy, or embargo.
161 static base::string16 PermissionDecisionReasonToUIString(
162 Profile* profile,
163 const PermissionInfo& permission,
164 const GURL& url);
165
166 // Returns the color to use for the permission decision reason strings.
167 static SkColor GetPermissionDecisionTextColor();
168
158 // Returns the icon resource ID for the given permission |type| and |setting|. 169 // Returns the icon resource ID for the given permission |type| and |setting|.
159 static int GetPermissionIconID(ContentSettingsType type, 170 static int GetPermissionIconID(ContentSettingsType type,
160 ContentSetting setting); 171 ContentSetting setting);
161 172
162 // Returns the icon for the given permissionInfo |info|. If |info|'s current 173 // 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 174 // setting is CONTENT_SETTING_DEFAULT, it will return the icon for |info|'s
164 // default setting. 175 // default setting.
165 static const gfx::Image& GetPermissionIcon(const PermissionInfo& info); 176 static const gfx::Image& GetPermissionIcon(const PermissionInfo& info);
166 177
167 // Returns the UI string describing the given object |info|. 178 // Returns the UI string describing the given object |info|.
(...skipping 26 matching lines...) Expand all
194 205
195 // Sets site identity information. 206 // Sets site identity information.
196 virtual void SetIdentityInfo(const IdentityInfo& identity_info) = 0; 207 virtual void SetIdentityInfo(const IdentityInfo& identity_info) = 0;
197 }; 208 };
198 209
199 typedef PageInfoUI::CookieInfoList CookieInfoList; 210 typedef PageInfoUI::CookieInfoList CookieInfoList;
200 typedef PageInfoUI::PermissionInfoList PermissionInfoList; 211 typedef PageInfoUI::PermissionInfoList PermissionInfoList;
201 typedef PageInfoUI::ChosenObjectInfoList ChosenObjectInfoList; 212 typedef PageInfoUI::ChosenObjectInfoList ChosenObjectInfoList;
202 213
203 #endif // CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_UI_H_ 214 #endif // CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_UI_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/page_info/page_info_bubble_controller_unittest.mm ('k') | chrome/browser/ui/page_info/page_info_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698