Chromium Code Reviews| 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_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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/string16.h" | 12 #include "base/string16.h" |
| 13 #include "chrome/browser/ui/website_settings/website_settings.h" | 13 #include "chrome/browser/ui/website_settings/website_settings.h" |
| 14 #include "chrome/common/content_settings.h" | 14 #include "chrome/common/content_settings.h" |
| 15 #include "chrome/common/content_settings_types.h" | 15 #include "chrome/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 CookieInfoList; | 18 class CookieInfoList; |
| 19 class GURL; | 19 class GURL; |
| 20 class PermissionInfoList; | 20 class PermissionInfoList; |
| 21 class Profile; | 21 class Profile; |
| 22 class WebsiteSettings; | 22 class WebsiteSettings; |
| 23 | 23 |
| 24 namespace content { | 24 namespace content { |
| 25 struct SSLStatus; | 25 struct SSLStatus; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace gfx { | |
| 29 class Image; | |
| 30 } | |
| 31 | |
| 28 // The class |WebsiteSettingsUI| specifies the platform independent | 32 // The class |WebsiteSettingsUI| specifies the platform independent |
| 29 // interface of the website settings UI. The website settings UI displays | 33 // interface of the website settings UI. The website settings UI displays |
| 30 // information and controls for site specific data (local stored objects like | 34 // information and controls for site specific data (local stored objects like |
| 31 // cookies), site specific permissions (location, popup, plugin, etc. | 35 // cookies), site specific permissions (location, popup, plugin, etc. |
| 32 // permissions) and site specific information (identity, connection status, | 36 // permissions) and site specific information (identity, connection status, |
| 33 // etc.). | 37 // etc.). |
| 34 class WebsiteSettingsUI { | 38 class WebsiteSettingsUI { |
| 35 public: | 39 public: |
| 36 // |CookieInfo| contains information about the cookies from a specific source. | 40 // |CookieInfo| contains information about the cookies from a specific source. |
| 37 // A source can for example be a specific origin or an entire domain. | 41 // A source can for example be a specific origin or an entire domain. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 81 }; | 85 }; |
| 82 | 86 |
| 83 virtual ~WebsiteSettingsUI(); | 87 virtual ~WebsiteSettingsUI(); |
| 84 | 88 |
| 85 // Returns the resource ID of the UI string for the given permission |type|. | 89 // Returns the resource ID of the UI string for the given permission |type|. |
| 86 static int PermissionTypeToUIStringID(ContentSettingsType type); | 90 static int PermissionTypeToUIStringID(ContentSettingsType type); |
| 87 | 91 |
| 88 // Returns the resource ID of the UI string for the given permission |value|. | 92 // Returns the resource ID of the UI string for the given permission |value|. |
| 89 static int PermissionValueToUIStringID(ContentSetting value); | 93 static int PermissionValueToUIStringID(ContentSetting value); |
| 90 | 94 |
| 95 // Returns the icon for the given permission |type| and |setting|. | |
| 96 static const gfx::Image& GetPermissionIcon(ContentSettingsType type, | |
| 97 ContentSetting setting); | |
|
tfarina
2012/06/14 19:59:32
nit: wrong indentation here!
| |
| 98 | |
| 99 // Returns the identity icon for the given identity |status|. | |
| 100 static const gfx::Image& GetIdentityIcon( | |
| 101 WebsiteSettings::SiteIdentityStatus status); | |
| 102 | |
| 103 // Returns the connection icon for the given connection |status|. | |
| 104 static const gfx::Image& GetConnectionIcon( | |
| 105 WebsiteSettings::SiteConnectionStatus status); | |
| 106 | |
| 91 // Sets cookie information. | 107 // Sets cookie information. |
| 92 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) = 0; | 108 virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) = 0; |
| 93 | 109 |
| 94 // Sets permision information. | 110 // Sets permision information. |
| 95 virtual void SetPermissionInfo( | 111 virtual void SetPermissionInfo( |
| 96 const PermissionInfoList& permission_info_list) = 0; | 112 const PermissionInfoList& permission_info_list) = 0; |
| 97 | 113 |
| 98 // Sets site identity information. | 114 // Sets site identity information. |
| 99 virtual void SetIdentityInfo(const IdentityInfo& identity_info) = 0; | 115 virtual void SetIdentityInfo(const IdentityInfo& identity_info) = 0; |
| 100 | 116 |
| 101 // Sets the first visited data. |first_visit| can be an empty string. | 117 // Sets the first visited data. |first_visit| can be an empty string. |
| 102 virtual void SetFirstVisit(const string16& first_visit) = 0; | 118 virtual void SetFirstVisit(const string16& first_visit) = 0; |
| 103 }; | 119 }; |
| 104 | 120 |
| 105 class CookieInfoList : public std::vector<WebsiteSettingsUI::CookieInfo> { | 121 class CookieInfoList : public std::vector<WebsiteSettingsUI::CookieInfo> { |
| 106 }; | 122 }; |
| 107 | 123 |
| 108 class PermissionInfoList | 124 class PermissionInfoList |
| 109 : public std::vector<WebsiteSettingsUI::PermissionInfo> { | 125 : public std::vector<WebsiteSettingsUI::PermissionInfo> { |
| 110 }; | 126 }; |
| 111 | 127 |
| 112 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_UI_H_ | 128 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_UI_H_ |
| OLD | NEW |