Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1063)

Side by Side Diff: chrome/browser/cocoa/page_info_bubble_controller.h

Issue 3560004: Refactor the code for loading icons into the PageInfoModel. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: cleanup Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/mac_util_unittest.mm ('k') | chrome/browser/cocoa/page_info_bubble_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/scoped_nsobject.h" 7 #include "base/scoped_nsobject.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #import "chrome/browser/cocoa/base_bubble_controller.h" 9 #import "chrome/browser/cocoa/base_bubble_controller.h"
10 #include "chrome/browser/page_info_model.h" 10 #include "chrome/browser/page_info_model.h"
11 11
12 // This NSWindowController subclass manages the InfoBubbleWindow and view that 12 // This NSWindowController subclass manages the InfoBubbleWindow and view that
13 // are displayed when the user clicks the security lock icon. 13 // are displayed when the user clicks the security lock icon.
14 @interface PageInfoBubbleController : BaseBubbleController { 14 @interface PageInfoBubbleController : BaseBubbleController {
15 @private 15 @private
16 // The model that generates the content displayed by the controller. 16 // The model that generates the content displayed by the controller.
17 scoped_ptr<PageInfoModel> model_; 17 scoped_ptr<PageInfoModel> model_;
18 18
19 // Thin bridge that pushes model-changed notifications from C++ to Cocoa. 19 // Thin bridge that pushes model-changed notifications from C++ to Cocoa.
20 scoped_ptr<PageInfoModel::PageInfoModelObserver> bridge_; 20 scoped_ptr<PageInfoModel::PageInfoModelObserver> bridge_;
21 21
22 // The certificate ID for the page, 0 if the page is not over HTTPS. 22 // The certificate ID for the page, 0 if the page is not over HTTPS.
23 int certID_; 23 int certID_;
24
25 // Reference to the images that are placed within the UI.
26 scoped_nsobject<NSImage> okImage_;
27 scoped_nsobject<NSImage> warningMinorImage_;
28 scoped_nsobject<NSImage> warningMajorImage_;
29 scoped_nsobject<NSImage> errorImage_;
30 } 24 }
31 25
32 @property (nonatomic, assign) int certID; 26 @property (nonatomic, assign) int certID;
33 27
34 // Designated initializer. The new instance will take ownership of |model| and 28 // Designated initializer. The new instance will take ownership of |model| and
35 // |bridge|. There should be a 1:1 mapping of models to bridges. The 29 // |bridge|. There should be a 1:1 mapping of models to bridges. The
36 // controller will release itself when the bubble is closed. 30 // controller will release itself when the bubble is closed.
37 - (id)initWithPageInfoModel:(PageInfoModel*)model 31 - (id)initWithPageInfoModel:(PageInfoModel*)model
38 modelObserver:(PageInfoModel::PageInfoModelObserver*)bridge 32 modelObserver:(PageInfoModel::PageInfoModelObserver*)bridge
39 parentWindow:(NSWindow*)parentWindow; 33 parentWindow:(NSWindow*)parentWindow;
40 34
41 // Shows the certificate display window. Note that this will implicitly close 35 // Shows the certificate display window. Note that this will implicitly close
42 // the bubble because the certificate window will become key. The certificate 36 // the bubble because the certificate window will become key. The certificate
43 // information attaches itself as a sheet to the |parentWindow|. 37 // information attaches itself as a sheet to the |parentWindow|.
44 - (IBAction)showCertWindow:(id)sender; 38 - (IBAction)showCertWindow:(id)sender;
45 39
46 @end 40 @end
47 41
48 @interface PageInfoBubbleController (ExposedForUnitTesting) 42 @interface PageInfoBubbleController (ExposedForUnitTesting)
49 - (void)performLayout; 43 - (void)performLayout;
50 @end 44 @end
OLDNEW
« no previous file with comments | « base/mac_util_unittest.mm ('k') | chrome/browser/cocoa/page_info_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698