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

Side by Side Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.h

Issue 2306673003: Material Page Info (Views, 3/3): Update site settings section. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix up unused includes. Created 4 years, 2 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_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
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
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 // The header section (containing security-related information). 143 // The header section (containing security-related information).
153 PopupHeaderView* header_; 144 PopupHeaderView* header_;
154 145
155 // The separator between the header and the site settings view. 146 // The separator between the header and the site settings view.
156 views::Separator* separator_; 147 views::Separator* separator_;
157 148
158 // The view that contains the site data and permissions sections. 149 // The view that contains the cookie and permissions sections.
159 views::View* site_settings_view_; 150 views::View* site_settings_view_;
160 // The view that contains the contents of the "Cookies and Site data" section 151 // The view that contains the contents of the "Cookies" part of the site
161 // of the site settings view. 152 // settings view.
162 views::View* site_data_content_; 153 views::View* cookies_view_;
163 // The link that opens the "Cookies" dialog. 154 // The link that opens the "Cookies" dialog.
164 views::Link* cookie_dialog_link_; 155 views::Link* cookie_dialog_link_;
165 // The view that contains the contents of the "Permissions" section 156 // The view that contains the "Permissions" table of the site settings view.
166 // of the site settings view. 157 views::View* permissions_view_;
167 views::View* permissions_content_;
168 158
169 // The certificate provided by the site, if one exists. 159 // The certificate provided by the site, if one exists.
170 scoped_refptr<net::X509Certificate> certificate_; 160 scoped_refptr<net::X509Certificate> certificate_;
171 161
172 // The link to open the site settings page that provides full control over
173 // the origin's permissions.
174 views::Link* site_settings_link_;
175
176 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_; 162 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_;
177 163
178 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); 164 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView);
179 }; 165 };
180 166
181 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_ H_ 167 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698