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

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

Issue 2448943002: Refactor SecurityStateModel/Clients for simplicity and reusability. (Closed)
Patch Set: sync. Created 4 years, 1 month 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 "chrome/browser/ui/views/website_settings/chosen_object_row_observer.h" 13 #include "chrome/browser/ui/views/website_settings/chosen_object_row_observer.h"
14 #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"
15 #include "chrome/browser/ui/website_settings/website_settings_ui.h" 15 #include "chrome/browser/ui/website_settings/website_settings_ui.h"
16 #include "components/security_state/security_state_model.h"
17 #include "content/public/browser/web_contents_observer.h" 16 #include "content/public/browser/web_contents_observer.h"
18 #include "ui/views/bubble/bubble_dialog_delegate.h" 17 #include "ui/views/bubble/bubble_dialog_delegate.h"
19 #include "ui/views/controls/button/button.h" 18 #include "ui/views/controls/button/button.h"
20 #include "ui/views/controls/link_listener.h" 19 #include "ui/views/controls/link_listener.h"
21 #include "ui/views/controls/separator.h" 20 #include "ui/views/controls/separator.h"
22 #include "ui/views/controls/styled_label_listener.h" 21 #include "ui/views/controls/styled_label_listener.h"
23 22
24 class GURL; 23 class GURL;
25 class PopupHeaderView; 24 class PopupHeaderView;
26 class Profile; 25 class Profile;
27 26
28 namespace content { 27 namespace content {
29 class WebContents; 28 class WebContents;
30 } 29 }
31 30
32 namespace net { 31 namespace net {
33 class X509Certificate; 32 class X509Certificate;
34 } 33 }
35 34
35 namespace security_state {
36 struct SecurityInfo;
37 } // namespace security_state
38
36 namespace test { 39 namespace test {
37 class WebsiteSettingsPopupViewTestApi; 40 class WebsiteSettingsPopupViewTestApi;
38 } 41 }
39 42
40 namespace views { 43 namespace views {
41 class ImageButton; 44 class ImageButton;
42 class Label; 45 class Label;
43 class LabelButton; 46 class LabelButton;
44 class Link; 47 class Link;
45 class Widget; 48 class Widget;
(...skipping 21 matching lines...) Expand all
67 // Type of the popup being displayed. 70 // Type of the popup being displayed.
68 enum PopupType { 71 enum PopupType {
69 POPUP_NONE, 72 POPUP_NONE,
70 // Usual page info bubble for websites. 73 // Usual page info bubble for websites.
71 POPUP_WEBSITE_SETTINGS, 74 POPUP_WEBSITE_SETTINGS,
72 // Custom bubble for internal pages like chrome:// and chrome-extensions://. 75 // Custom bubble for internal pages like chrome:// and chrome-extensions://.
73 POPUP_INTERNAL_PAGE 76 POPUP_INTERNAL_PAGE
74 }; 77 };
75 78
76 // If |anchor_view| is null, |anchor_rect| is used to anchor the bubble. 79 // If |anchor_view| is null, |anchor_rect| is used to anchor the bubble.
77 static void ShowPopup( 80 static void ShowPopup(views::View* anchor_view,
78 views::View* anchor_view, 81 const gfx::Rect& anchor_rect,
79 const gfx::Rect& anchor_rect, 82 Profile* profile,
80 Profile* profile, 83 content::WebContents* web_contents,
81 content::WebContents* web_contents, 84 const GURL& url,
82 const GURL& url, 85 const security_state::SecurityInfo& security_info);
83 const security_state::SecurityStateModel::SecurityInfo& security_info);
84 86
85 // Returns the type of the popup bubble being shown. 87 // Returns the type of the popup bubble being shown.
86 static PopupType GetShownPopupType(); 88 static PopupType GetShownPopupType();
87 89
88 private: 90 private:
89 friend class test::WebsiteSettingsPopupViewTestApi; 91 friend class test::WebsiteSettingsPopupViewTestApi;
90 92
91 WebsiteSettingsPopupView( 93 WebsiteSettingsPopupView(views::View* anchor_view,
92 views::View* anchor_view, 94 gfx::NativeView parent_window,
93 gfx::NativeView parent_window, 95 Profile* profile,
94 Profile* profile, 96 content::WebContents* web_contents,
95 content::WebContents* web_contents, 97 const GURL& url,
96 const GURL& url, 98 const security_state::SecurityInfo& security_info);
97 const security_state::SecurityStateModel::SecurityInfo& security_info);
98 99
99 // WebContentsObserver implementation. 100 // WebContentsObserver implementation.
100 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; 101 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
101 void WebContentsDestroyed() override; 102 void WebContentsDestroyed() override;
102 103
103 // PermissionSelectorRowObserver implementation. 104 // PermissionSelectorRowObserver implementation.
104 void OnPermissionChanged( 105 void OnPermissionChanged(
105 const WebsiteSettingsUI::PermissionInfo& permission) override; 106 const WebsiteSettingsUI::PermissionInfo& permission) override;
106 107
107 // ChosenObjectRowObserver implementation. 108 // ChosenObjectRowObserver implementation.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 170
170 // The certificate provided by the site, if one exists. 171 // The certificate provided by the site, if one exists.
171 scoped_refptr<net::X509Certificate> certificate_; 172 scoped_refptr<net::X509Certificate> certificate_;
172 173
173 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_; 174 base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_;
174 175
175 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView); 176 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView);
176 }; 177 };
177 178
178 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_ H_ 179 #endif // CHROME_BROWSER_UI_VIEWS_WEBSITE_SETTINGS_WEBSITE_SETTINGS_POPUP_VIEW_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698