| 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_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
| 13 #include "base/strings/string16.h" | |
| 14 #include "chrome/browser/ui/views/website_settings/chosen_object_row_observer.h" | 13 #include "chrome/browser/ui/views/website_settings/chosen_object_row_observer.h" |
| 15 #include "chrome/browser/ui/views/website_settings/permission_selector_row_obser
ver.h" | 14 #include "chrome/browser/ui/views/website_settings/permission_selector_row_obser
ver.h" |
| 16 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 15 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 17 #include "components/security_state/security_state_model.h" | 16 #include "components/security_state/security_state_model.h" |
| 18 #include "content/public/browser/web_contents_observer.h" | 17 #include "content/public/browser/web_contents_observer.h" |
| 19 #include "ui/views/bubble/bubble_dialog_delegate.h" | 18 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 20 #include "ui/views/controls/button/button.h" | 19 #include "ui/views/controls/button/button.h" |
| 21 #include "ui/views/controls/link_listener.h" | 20 #include "ui/views/controls/link_listener.h" |
| 22 #include "ui/views/controls/separator.h" | 21 #include "ui/views/controls/separator.h" |
| 23 #include "ui/views/controls/styled_label_listener.h" | 22 #include "ui/views/controls/styled_label_listener.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 43 class Label; | 42 class Label; |
| 44 class LabelButton; | 43 class LabelButton; |
| 45 class Link; | 44 class Link; |
| 46 class Widget; | 45 class Widget; |
| 47 } | 46 } |
| 48 | 47 |
| 49 enum : int { | 48 enum : int { |
| 50 // Left icon margin. | 49 // Left icon margin. |
| 51 kPermissionIconMarginLeft = 6, | 50 kPermissionIconMarginLeft = 6, |
| 52 // The width of the column that contains the permissions icons. | 51 // The width of the column that contains the permissions icons. |
| 53 kPermissionIconColumnWidth = 20, | 52 kPermissionIconColumnWidth = 16, |
| 54 }; | 53 }; |
| 55 | 54 |
| 56 // The views implementation of the website settings UI. | 55 // The views implementation of the website settings UI. |
| 57 class WebsiteSettingsPopupView : public content::WebContentsObserver, | 56 class WebsiteSettingsPopupView : public content::WebContentsObserver, |
| 58 public PermissionSelectorRowObserver, | 57 public PermissionSelectorRowObserver, |
| 59 public ChosenObjectRowObserver, | 58 public ChosenObjectRowObserver, |
| 60 public views::BubbleDialogDelegateView, | 59 public views::BubbleDialogDelegateView, |
| 61 public views::ButtonListener, | 60 public views::ButtonListener, |
| 62 public views::LinkListener, | 61 public views::LinkListener, |
| 63 public views::StyledLabelListener, | 62 public views::StyledLabelListener, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 const PermissionInfoList& permission_info_list, | 122 const PermissionInfoList& permission_info_list, |
| 124 const ChosenObjectInfoList& chosen_object_info_list) override; | 123 const ChosenObjectInfoList& chosen_object_info_list) override; |
| 125 void SetIdentityInfo(const IdentityInfo& identity_info) override; | 124 void SetIdentityInfo(const IdentityInfo& identity_info) override; |
| 126 // TODO(lgarron): Remove SetSelectedTab() with https://crbug.com/571533 | 125 // TODO(lgarron): Remove SetSelectedTab() with https://crbug.com/571533 |
| 127 void SetSelectedTab(TabId tab_id) override; | 126 void SetSelectedTab(TabId tab_id) override; |
| 128 | 127 |
| 129 // Creates the contents of the |site_settings_view_|. The ownership of the | 128 // Creates the contents of the |site_settings_view_|. The ownership of the |
| 130 // returned view is transferred to the caller. | 129 // returned view is transferred to the caller. |
| 131 views::View* CreateSiteSettingsView() WARN_UNUSED_RESULT; | 130 views::View* CreateSiteSettingsView() WARN_UNUSED_RESULT; |
| 132 | 131 |
| 133 // The site settings view contains several sections with a |headline| | |
| 134 // followed by the section |contents| and an optional |link|. This method | |
| 135 // creates a section for the given |headline|, |contents| and |link|. |link| | |
| 136 // can be NULL if the section should not contain a link. | |
| 137 views::View* CreateSection(const base::string16& headline, | |
| 138 views::View* contents, | |
| 139 views::Link* link) WARN_UNUSED_RESULT; | |
| 140 | |
| 141 // Used to asynchronously handle clicks since these calls may cause the | 132 // Used to asynchronously handle clicks since these calls may cause the |
| 142 // destruction of the settings view and the base class window still needs to | 133 // destruction of the settings view and the base class window still needs to |
| 143 // be alive to finish handling the mouse or keyboard click. | 134 // be alive to finish handling the mouse or keyboard click. |
| 144 void HandleLinkClickedAsync(views::Link* source); | 135 void HandleLinkClickedAsync(views::Link* source); |
| 145 | 136 |
| 146 // Whether DevTools is disabled for the relevant profile. | 137 // Whether DevTools is disabled for the relevant profile. |
| 147 bool is_devtools_disabled_; | 138 bool is_devtools_disabled_; |
| 148 | 139 |
| 149 // The presenter that controls the Website Settings UI. | 140 // The presenter that controls the Website Settings UI. |
| 150 std::unique_ptr<WebsiteSettings> presenter_; | 141 std::unique_ptr<WebsiteSettings> presenter_; |
| 151 | 142 |
| 152 Profile* profile_; | 143 Profile* profile_; |
| 153 | 144 |
| 154 // The header section (containing security-related information). | 145 // The header section (containing security-related information). |
| 155 PopupHeaderView* header_; | 146 PopupHeaderView* header_; |
| 156 | 147 |
| 157 // The separator between the header and the site settings view. | 148 // The separator between the header and the site settings view. |
| 158 views::Separator* separator_; | 149 views::Separator* separator_; |
| 159 | 150 |
| 160 // The view that contains the site data and permissions sections. | 151 // The view that contains the cookie and permissions sections. |
| 161 views::View* site_settings_view_; | 152 views::View* site_settings_view_; |
| 162 // The view that contains the contents of the "Cookies and Site data" section | 153 // The view that contains the contents of the "Cookies" part of the site |
| 163 // of the site settings view. | 154 // settings view. |
| 164 views::View* site_data_content_; | 155 views::View* cookies_view_; |
| 165 // The link that opens the "Cookies" dialog. | 156 // The link that opens the "Cookies" dialog. |
| 166 views::Link* cookie_dialog_link_; | 157 views::Link* cookie_dialog_link_; |
| 167 // The view that contains the contents of the "Permissions" section | 158 // The view that contains the "Permissions" table of the site settings view. |
| 168 // of the site settings view. | 159 views::View* permissions_view_; |
| 169 views::View* permissions_content_; | |
| 170 | 160 |
| 171 // The certificate provided by the site, if one exists. | 161 // The certificate provided by the site, if one exists. |
| 172 scoped_refptr<net::X509Certificate> certificate_; | 162 scoped_refptr<net::X509Certificate> certificate_; |
| 173 | 163 |
| 174 // The link to open the site settings page that provides full control over | |
| 175 // the origin's permissions. | |
| 176 views::Link* site_settings_link_; | |
| 177 | |
| 178 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_; | 164 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_; |
| 179 | 165 |
| 180 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); | 166 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); |
| 181 }; | 167 }; |
| 182 | 168 |
| 183 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_
H_ | 169 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_
H_ |
| OLD | NEW |