OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 11 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
12 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 12 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
13 #include "components/security_state/security_state_model.h" | |
14 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
15 | 14 |
16 class WebsiteSettingsUIBridge; | 15 class WebsiteSettingsUIBridge; |
17 | 16 |
18 namespace content { | 17 namespace content { |
19 class WebContents; | 18 class WebContents; |
20 } | 19 } |
21 | 20 |
22 namespace net { | 21 namespace net { |
23 class X509Certificate; | 22 class X509Certificate; |
24 } | 23 } |
25 | 24 |
| 25 namespace security_state { |
| 26 struct SecurityInfo; |
| 27 } // namespace security_state |
| 28 |
26 // This NSWindowController subclass manages the InfoBubbleWindow and view that | 29 // This NSWindowController subclass manages the InfoBubbleWindow and view that |
27 // are displayed when the user clicks the favicon or security lock icon. | 30 // are displayed when the user clicks the favicon or security lock icon. |
28 // | 31 // |
29 // TODO(palmer): Normalize all WebsiteSettings*, SiteSettings*, PageInfo*, et c. | 32 // TODO(palmer): Normalize all WebsiteSettings*, SiteSettings*, PageInfo*, et c. |
30 // to OriginInfo*. | 33 // to OriginInfo*. |
31 @interface WebsiteSettingsBubbleController : BaseBubbleController { | 34 @interface WebsiteSettingsBubbleController : BaseBubbleController { |
32 @private | 35 @private |
33 content::WebContents* webContents_; | 36 content::WebContents* webContents_; |
34 | 37 |
35 base::scoped_nsobject<NSView> contentView_; | 38 base::scoped_nsobject<NSView> contentView_; |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 class WebsiteSettingsUIBridge : public content::WebContentsObserver, | 120 class WebsiteSettingsUIBridge : public content::WebContentsObserver, |
118 public WebsiteSettingsUI { | 121 public WebsiteSettingsUI { |
119 public: | 122 public: |
120 explicit WebsiteSettingsUIBridge(content::WebContents* web_contents); | 123 explicit WebsiteSettingsUIBridge(content::WebContents* web_contents); |
121 ~WebsiteSettingsUIBridge() override; | 124 ~WebsiteSettingsUIBridge() override; |
122 | 125 |
123 // Creates a |WebsiteSettingsBubbleController| and displays the UI. |parent| | 126 // Creates a |WebsiteSettingsBubbleController| and displays the UI. |parent| |
124 // is the currently active window. |profile| points to the currently active | 127 // is the currently active window. |profile| points to the currently active |
125 // profile. |web_contents| points to the WebContents that wraps the currently | 128 // profile. |web_contents| points to the WebContents that wraps the currently |
126 // active tab. |virtual_url| is the virtual GURL of the currently active | 129 // active tab. |virtual_url| is the virtual GURL of the currently active |
127 // tab. |security_info| is the | 130 // tab. |security_info| is the |security_state::SecurityInfo| of the |
128 // |security_state::SecurityStateModel::SecurityInfo| of | 131 // connection to the website in the currently active tab. |
129 // the connection to the website in the currently active tab. | 132 static void Show(gfx::NativeWindow parent, |
130 static void Show( | 133 Profile* profile, |
131 gfx::NativeWindow parent, | 134 content::WebContents* web_contents, |
132 Profile* profile, | 135 const GURL& virtual_url, |
133 content::WebContents* web_contents, | 136 const security_state::SecurityInfo& security_info); |
134 const GURL& virtual_url, | |
135 const security_state::SecurityStateModel::SecurityInfo& security_info); | |
136 | 137 |
137 void set_bubble_controller( | 138 void set_bubble_controller( |
138 WebsiteSettingsBubbleController* bubble_controller); | 139 WebsiteSettingsBubbleController* bubble_controller); |
139 | 140 |
140 // WebContentsObserver implementation. | 141 // WebContentsObserver implementation. |
141 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; | 142 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; |
142 | 143 |
143 // WebsiteSettingsUI implementations. | 144 // WebsiteSettingsUI implementations. |
144 void SetCookieInfo(const CookieInfoList& cookie_info_list) override; | 145 void SetCookieInfo(const CookieInfoList& cookie_info_list) override; |
145 void SetPermissionInfo(const PermissionInfoList& permission_info_list, | 146 void SetPermissionInfo(const PermissionInfoList& permission_info_list, |
146 ChosenObjectInfoList chosen_object_info_list) override; | 147 ChosenObjectInfoList chosen_object_info_list) override; |
147 void SetIdentityInfo(const IdentityInfo& identity_info) override; | 148 void SetIdentityInfo(const IdentityInfo& identity_info) override; |
148 void SetSelectedTab(TabId tab_id) override; | 149 void SetSelectedTab(TabId tab_id) override; |
149 | 150 |
150 private: | 151 private: |
151 // The WebContents the bubble UI is attached to. | 152 // The WebContents the bubble UI is attached to. |
152 content::WebContents* web_contents_; | 153 content::WebContents* web_contents_; |
153 | 154 |
154 // The Cocoa controller for the bubble UI. | 155 // The Cocoa controller for the bubble UI. |
155 WebsiteSettingsBubbleController* bubble_controller_; | 156 WebsiteSettingsBubbleController* bubble_controller_; |
156 | 157 |
157 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsUIBridge); | 158 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsUIBridge); |
158 }; | 159 }; |
OLD | NEW |