OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_nsobject.h" | 7 #include "base/memory/scoped_nsobject.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | 9 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" |
10 | 10 |
11 class PageInfoModel; | 11 class PageInfoModel; |
12 class PageInfoModelObserver; | 12 class PageInfoModelObserver; |
13 | 13 |
| 14 namespace content { |
| 15 class PageNavigator; |
| 16 } |
| 17 |
14 // This NSWindowController subclass manages the InfoBubbleWindow and view that | 18 // This NSWindowController subclass manages the InfoBubbleWindow and view that |
15 // are displayed when the user clicks the security lock icon. | 19 // are displayed when the user clicks the security lock icon. |
16 @interface PageInfoBubbleController : BaseBubbleController { | 20 @interface PageInfoBubbleController : BaseBubbleController { |
17 @private | 21 @private |
18 // The model that generates the content displayed by the controller. | 22 // The model that generates the content displayed by the controller. |
19 scoped_ptr<PageInfoModel> model_; | 23 scoped_ptr<PageInfoModel> model_; |
20 | 24 |
21 // Thin bridge that pushes model-changed notifications from C++ to Cocoa. | 25 // Thin bridge that pushes model-changed notifications from C++ to Cocoa. |
22 scoped_ptr<PageInfoModelObserver> bridge_; | 26 scoped_ptr<PageInfoModelObserver> bridge_; |
23 | 27 |
24 // The certificate ID for the page, 0 if the page is not over HTTPS. | 28 // The certificate ID for the page, 0 if the page is not over HTTPS. |
25 int certID_; | 29 int certID_; |
| 30 |
| 31 // Used for loading pages. |
| 32 content::PageNavigator* navigator_; |
26 } | 33 } |
27 | 34 |
28 @property(nonatomic, assign) int certID; | 35 @property(nonatomic, assign) int certID; |
29 | 36 |
30 // Designated initializer. The new instance will take ownership of |model| and | 37 // Designated initializer. The new instance will take ownership of |model| and |
31 // |bridge|. There should be a 1:1 mapping of models to bridges. The | 38 // |bridge|. There should be a 1:1 mapping of models to bridges. The |
32 // controller will release itself when the bubble is closed. |parentWindow| | 39 // controller will release itself when the bubble is closed. |parentWindow| |
33 // cannot be nil. | 40 // cannot be nil. |
34 - (id)initWithPageInfoModel:(PageInfoModel*)model | 41 - (id)initWithPageInfoModel:(PageInfoModel*)model |
35 modelObserver:(PageInfoModelObserver*)bridge | 42 modelObserver:(PageInfoModelObserver*)bridge |
36 parentWindow:(NSWindow*)parentWindow; | 43 parentWindow:(NSWindow*)parentWindow |
| 44 navigator:(content::PageNavigator*)navigator; |
| 45 |
37 | 46 |
38 // Shows the certificate display window. Note that this will implicitly close | 47 // Shows the certificate display window. Note that this will implicitly close |
39 // the bubble because the certificate window will become key. The certificate | 48 // the bubble because the certificate window will become key. The certificate |
40 // information attaches itself as a sheet to the |parentWindow|. | 49 // information attaches itself as a sheet to the |parentWindow|. |
41 - (IBAction)showCertWindow:(id)sender; | 50 - (IBAction)showCertWindow:(id)sender; |
42 | 51 |
43 // Opens the help center link that explains the contents of the page info. | 52 // Opens the help center link that explains the contents of the page info. |
44 - (IBAction)showHelpPage:(id)sender; | 53 - (IBAction)showHelpPage:(id)sender; |
45 | 54 |
46 @end | 55 @end |
47 | 56 |
48 @interface PageInfoBubbleController (ExposedForUnitTesting) | 57 @interface PageInfoBubbleController (ExposedForUnitTesting) |
49 - (void)performLayout; | 58 - (void)performLayout; |
50 @end | 59 @end |
OLD | NEW |