| 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 #ifndef CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_BUBBLE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_BUBBLE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_BUBBLE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_BUBBLE_CONTROLLER_H_ |
| 7 | 7 |
| 8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/mac/scoped_nsobject.h" | 12 #include "base/mac/scoped_nsobject.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #import "chrome/browser/ui/cocoa/omnibox_decoration_bubble_controller.h" | 14 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
| 15 #include "chrome/browser/ui/page_info/page_info_ui.h" | 15 #include "chrome/browser/ui/page_info/page_info_ui.h" |
| 16 #include "content/public/browser/web_contents_observer.h" | 16 #include "content/public/browser/web_contents_observer.h" |
| 17 | 17 |
| 18 class LocationBarDecoration; |
| 18 class PageInfoUIBridge; | 19 class PageInfoUIBridge; |
| 19 | 20 |
| 20 namespace content { | 21 namespace content { |
| 21 class WebContents; | 22 class WebContents; |
| 22 } | 23 } |
| 23 | 24 |
| 24 namespace net { | 25 namespace net { |
| 25 class X509Certificate; | 26 class X509Certificate; |
| 26 } | 27 } |
| 27 | 28 |
| 28 namespace security_state { | 29 namespace security_state { |
| 29 struct SecurityInfo; | 30 struct SecurityInfo; |
| 30 } // namespace security_state | 31 } // namespace security_state |
| 31 | 32 |
| 32 // This NSWindowController subclass manages the InfoBubbleWindow and view that | 33 // This NSWindowController subclass manages the InfoBubbleWindow and view that |
| 33 // are displayed when the user clicks the favicon or security lock icon. | 34 // are displayed when the user clicks the favicon or security lock icon. |
| 34 @interface PageInfoBubbleController : OmniboxDecorationBubbleController { | 35 @interface PageInfoBubbleController : BaseBubbleController { |
| 35 @private | 36 @private |
| 36 content::WebContents* webContents_; | 37 content::WebContents* webContents_; |
| 37 | 38 |
| 38 base::scoped_nsobject<NSView> contentView_; | 39 base::scoped_nsobject<NSView> contentView_; |
| 39 | 40 |
| 40 // The main content view for the Permissions tab. | 41 // The main content view for the Permissions tab. |
| 41 NSView* securitySectionView_; | 42 NSView* securitySectionView_; |
| 42 | 43 |
| 43 // Displays the short security summary for the page | 44 // Displays the short security summary for the page |
| 44 // (private/not private/etc.). | 45 // (private/not private/etc.). |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // The link button for showing site settings. | 88 // The link button for showing site settings. |
| 88 NSButton* siteSettingsButton_; | 89 NSButton* siteSettingsButton_; |
| 89 | 90 |
| 90 // The UI translates user actions to specific events and forwards them to the | 91 // The UI translates user actions to specific events and forwards them to the |
| 91 // |presenter_|. The |presenter_| handles these events and updates the UI. | 92 // |presenter_|. The |presenter_| handles these events and updates the UI. |
| 92 std::unique_ptr<PageInfo> presenter_; | 93 std::unique_ptr<PageInfo> presenter_; |
| 93 | 94 |
| 94 // Bridge which implements the PageInfoUI interface and forwards | 95 // Bridge which implements the PageInfoUI interface and forwards |
| 95 // methods on to this class. | 96 // methods on to this class. |
| 96 std::unique_ptr<PageInfoUIBridge> bridge_; | 97 std::unique_ptr<PageInfoUIBridge> bridge_; |
| 98 |
| 99 // The omnibox icon the bubble is anchored to. The icon is set as active |
| 100 // when the bubble is opened, and inactive when the bubble is closed. |
| 101 // Usually we would override OmniboxDecorationBubbleController but the page |
| 102 // info icon has a race condition where it might switch between |
| 103 // LocationIconDecoration and SecurityStateBubbleDecoration. |
| 104 LocationBarDecoration* decoration_; // Weak. |
| 97 } | 105 } |
| 98 | 106 |
| 99 // Designated initializer. The controller will release itself when the bubble | 107 // Designated initializer. The controller will release itself when the bubble |
| 100 // is closed. |parentWindow| cannot be nil. |webContents| may be nil for | 108 // is closed. |parentWindow| cannot be nil. |webContents| may be nil for |
| 101 // testing purposes. | 109 // testing purposes. |
| 102 - (id)initWithParentWindow:(NSWindow*)parentWindow | 110 - (id)initWithParentWindow:(NSWindow*)parentWindow |
| 103 pageInfoUIBridge:(PageInfoUIBridge*)bridge | 111 pageInfoUIBridge:(PageInfoUIBridge*)bridge |
| 104 webContents:(content::WebContents*)webContents | 112 webContents:(content::WebContents*)webContents |
| 105 url:(const GURL&)url; | 113 url:(const GURL&)url; |
| 106 | 114 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // The WebContents the bubble UI is attached to. | 153 // The WebContents the bubble UI is attached to. |
| 146 content::WebContents* web_contents_; | 154 content::WebContents* web_contents_; |
| 147 | 155 |
| 148 // The Cocoa controller for the bubble UI. | 156 // The Cocoa controller for the bubble UI. |
| 149 PageInfoBubbleController* bubble_controller_; | 157 PageInfoBubbleController* bubble_controller_; |
| 150 | 158 |
| 151 DISALLOW_COPY_AND_ASSIGN(PageInfoUIBridge); | 159 DISALLOW_COPY_AND_ASSIGN(PageInfoUIBridge); |
| 152 }; | 160 }; |
| 153 | 161 |
| 154 #endif // CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_BUBBLE_CONTROLLER_H_ | 162 #endif // CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_BUBBLE_CONTROLLER_H_ |
| OLD | NEW |