| 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 "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/ssl/security_state_model.h" | |
| 10 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 9 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
| 11 #include "chrome/browser/ui/website_settings/website_settings_ui.h" | 10 #include "chrome/browser/ui/website_settings/website_settings_ui.h" |
| 11 #include "components/security_state/security_state_model.h" |
| 12 #include "content/public/browser/web_contents_observer.h" | 12 #include "content/public/browser/web_contents_observer.h" |
| 13 | 13 |
| 14 class WebsiteSettingsUIBridge; | 14 class WebsiteSettingsUIBridge; |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class WebContents; | 17 class WebContents; |
| 18 } | 18 } |
| 19 | 19 |
| 20 // This NSWindowController subclass manages the InfoBubbleWindow and view that | 20 // This NSWindowController subclass manages the InfoBubbleWindow and view that |
| 21 // are displayed when the user clicks the favicon or security lock icon. | 21 // are displayed when the user clicks the favicon or security lock icon. |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 class WebsiteSettingsUIBridge : public content::WebContentsObserver, | 104 class WebsiteSettingsUIBridge : public content::WebContentsObserver, |
| 105 public WebsiteSettingsUI { | 105 public WebsiteSettingsUI { |
| 106 public: | 106 public: |
| 107 explicit WebsiteSettingsUIBridge(content::WebContents* web_contents); | 107 explicit WebsiteSettingsUIBridge(content::WebContents* web_contents); |
| 108 ~WebsiteSettingsUIBridge() override; | 108 ~WebsiteSettingsUIBridge() override; |
| 109 | 109 |
| 110 // Creates a |WebsiteSettingsBubbleController| and displays the UI. |parent| | 110 // Creates a |WebsiteSettingsBubbleController| and displays the UI. |parent| |
| 111 // is the currently active window. |profile| points to the currently active | 111 // is the currently active window. |profile| points to the currently active |
| 112 // profile. |web_contents| points to the WebContents that wraps the currently | 112 // profile. |web_contents| points to the WebContents that wraps the currently |
| 113 // active tab. |url| is the GURL of the currently active | 113 // active tab. |url| is the GURL of the currently active |
| 114 // tab. |security_info| is the |SecurityStateModel::SecurityInfo| of | 114 // tab. |security_info| is the |
| 115 // |security_state::SecurityStateModel::SecurityInfo| of |
| 115 // the connection to the website in the currently active tab. | 116 // the connection to the website in the currently active tab. |
| 116 static void Show(gfx::NativeWindow parent, | 117 static void Show( |
| 117 Profile* profile, | 118 gfx::NativeWindow parent, |
| 118 content::WebContents* web_contents, | 119 Profile* profile, |
| 119 const GURL& url, | 120 content::WebContents* web_contents, |
| 120 const SecurityStateModel::SecurityInfo& security_info); | 121 const GURL& url, |
| 122 const security_state::SecurityStateModel::SecurityInfo& security_info); |
| 121 | 123 |
| 122 void set_bubble_controller( | 124 void set_bubble_controller( |
| 123 WebsiteSettingsBubbleController* bubble_controller); | 125 WebsiteSettingsBubbleController* bubble_controller); |
| 124 | 126 |
| 125 // WebContentsObserver implementation. | 127 // WebContentsObserver implementation. |
| 126 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; | 128 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override; |
| 127 | 129 |
| 128 // WebsiteSettingsUI implementations. | 130 // WebsiteSettingsUI implementations. |
| 129 void SetCookieInfo(const CookieInfoList& cookie_info_list) override; | 131 void SetCookieInfo(const CookieInfoList& cookie_info_list) override; |
| 130 void SetPermissionInfo( | 132 void SetPermissionInfo( |
| 131 const PermissionInfoList& permission_info_list) override; | 133 const PermissionInfoList& permission_info_list) override; |
| 132 void SetIdentityInfo(const IdentityInfo& identity_info) override; | 134 void SetIdentityInfo(const IdentityInfo& identity_info) override; |
| 133 void SetSelectedTab(TabId tab_id) override; | 135 void SetSelectedTab(TabId tab_id) override; |
| 134 | 136 |
| 135 private: | 137 private: |
| 136 // The WebContents the bubble UI is attached to. | 138 // The WebContents the bubble UI is attached to. |
| 137 content::WebContents* web_contents_; | 139 content::WebContents* web_contents_; |
| 138 | 140 |
| 139 // The Cocoa controller for the bubble UI. | 141 // The Cocoa controller for the bubble UI. |
| 140 WebsiteSettingsBubbleController* bubble_controller_; | 142 WebsiteSettingsBubbleController* bubble_controller_; |
| 141 | 143 |
| 142 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsUIBridge); | 144 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsUIBridge); |
| 143 }; | 145 }; |
| OLD | NEW |