OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_COCOA_ABOUT_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_COCOA_ABOUT_WINDOW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_COCOA_ABOUT_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_COCOA_ABOUT_WINDOW_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <AppKit/AppKit.h> |
9 #include "base/scoped_nsobject.h" | |
10 #import "chrome/app/keystone_glue.h" | |
11 | 9 |
12 @class BackgroundTileView; | 10 @class BackgroundTileView; |
13 class Profile; | 11 class Profile; |
14 | 12 |
15 // Returns an NSAttributedString that contains the locale specific legal text. | 13 // kUserClosedAboutNotification is the name of the notification posted when |
16 NSAttributedString* BuildAboutWindowLegalTextBlock(); | 14 // the About window is closed. |
| 15 extern const NSString* const kUserClosedAboutNotification; |
17 | 16 |
18 // A window controller that handles the branded (Chrome.app) about | 17 // A window controller that handles the About box. |
19 // window. The branded about window has a few features beyond the | 18 @interface AboutWindowController : NSWindowController { |
20 // standard Cocoa about panel. For example, opening the about window | |
21 // will check to see if this version is current and tell the user. | |
22 // There is also an "update me now" button with a progress spinner. | |
23 @interface AboutWindowController : NSWindowController<KeystoneGlueCallbacks> { | |
24 @private | 19 @private |
25 IBOutlet NSTextField* version_; | 20 IBOutlet NSTextField* version_; |
26 IBOutlet BackgroundTileView* backgroundView_; | 21 IBOutlet BackgroundTileView* backgroundView_; |
27 IBOutlet NSImageView* logoView_; | 22 IBOutlet NSImageView* logoView_; |
28 IBOutlet NSView* legalBlock_; | 23 IBOutlet NSView* legalBlock_; |
29 IBOutlet NSTextView* legalText_; | 24 IBOutlet NSTextView* legalText_; |
30 IBOutlet NSView* updateBlock_; // Holds everything related to updates | 25 IBOutlet NSView* updateBlock_; // Holds everything related to updates |
31 IBOutlet NSProgressIndicator* spinner_; | 26 IBOutlet NSProgressIndicator* spinner_; |
32 IBOutlet NSImageView* updateStatusIndicator_; | 27 IBOutlet NSImageView* updateStatusIndicator_; |
33 IBOutlet NSTextField* updateText_; | 28 IBOutlet NSTextField* updateText_; |
34 IBOutlet NSButton* updateNowButton_; | 29 IBOutlet NSButton* updateNowButton_; |
35 | 30 |
36 BOOL updateTriggered_; // Has an update ever been triggered? | 31 BOOL updateTriggered_; // Has an update ever been triggered? |
37 Profile* profile_; // Weak, probably the default profile. | 32 Profile* profile_; // Weak, probably the default profile. |
38 | |
39 // The version we got told about by Keystone | |
40 scoped_nsobject<NSString> newVersionAvailable_; | |
41 } | 33 } |
42 | 34 |
43 // Initialize the controller with the given profile, but does not show it. | 35 // Initialize the controller with the given profile, but does not show it. |
44 // Callers still need to call showWindow: to put it on screen. | 36 // Callers still need to call showWindow: to put it on screen. |
45 - (id)initWithProfile:(Profile*)profile; | 37 - (id)initWithProfile:(Profile*)profile; |
46 | 38 |
47 // Trigger an update right now, as initiated by a button. | 39 // Trigger an update right now, as initiated by a button. |
48 - (IBAction)updateNow:(id)sender; | 40 - (IBAction)updateNow:(id)sender; |
49 | 41 |
50 @end | 42 @end // @interface AboutWindowController |
51 | 43 |
| 44 @interface AboutWindowController(JustForTesting) |
52 | 45 |
53 @interface AboutWindowController (JustForTesting) | |
54 - (NSTextView*)legalText; | 46 - (NSTextView*)legalText; |
55 - (NSButton*)updateButton; | 47 - (NSButton*)updateButton; |
56 - (NSTextField*)updateText; | 48 - (NSTextField*)updateText; |
57 @end | |
58 | 49 |
| 50 // Returns an NSAttributedString that contains locale-specific legal text. |
| 51 + (NSAttributedString*)legalTextBlock; |
59 | 52 |
60 // NSNotification sent when the about window is closed. | 53 @end // @interface AboutWindowController(JustForTesting) |
61 extern NSString* const kUserClosedAboutNotification; | |
62 | 54 |
63 #endif // CHROME_BROWSER_COCOA_ABOUT_WINDOW_CONTROLLER_H_ | 55 #endif // CHROME_BROWSER_COCOA_ABOUT_WINDOW_CONTROLLER_H_ |
OLD | NEW |