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