• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_UI_COCOA_ABOUT_WINDOW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_ABOUT_WINDOW_CONTROLLER_H_
7 #pragma once
8 
9 #import <AppKit/AppKit.h>
10 
11 @class BackgroundTileView;
12 class Profile;
13 
14 // This simple subclass of |NSTextView| just doesn't show the (text) cursor
15 // (|NSTextView| displays the cursor with full keyboard accessibility enabled).
16 @interface AboutLegalTextView : NSTextView
17 @end
18 
19 // A window controller that handles the About box.
20 @interface AboutWindowController : NSWindowController {
21  @private
22   IBOutlet NSTextField* version_;
23   IBOutlet BackgroundTileView* backgroundView_;
24   IBOutlet NSImageView* logoView_;
25   IBOutlet NSView* legalBlock_;
26   IBOutlet AboutLegalTextView* legalText_;
27 
28   // updateBlock_ holds the update image or throbber, update text, and update
29   // button.
30   IBOutlet NSView* updateBlock_;
31 
32   IBOutlet NSProgressIndicator* spinner_;
33   IBOutlet NSImageView* updateStatusIndicator_;
34   IBOutlet NSTextField* updateText_;
35   IBOutlet NSButton* updateNowButton_;
36   IBOutlet NSButton* promoteButton_;
37 
38   Profile* profile_;  // Weak, probably the default profile.
39 
40   // The window frame height.  During an animation, this will contain the
41   // height being animated to.
42   CGFloat windowHeight_;
43 }
44 
45 // Initialize the controller with the given profile, but does not show it.
46 // Callers still need to call showWindow: to put it on screen.
47 - (id)initWithProfile:(Profile*)profile;
48 
49 // Trigger an update right now, as initiated by a button.
50 - (IBAction)updateNow:(id)sender;
51 
52 // Install a system Keystone if necessary and promote the ticket to a system
53 // ticket.
54 - (IBAction)promoteUpdater:(id)sender;
55 
56 @end  // @interface AboutWindowController
57 
58 @interface AboutWindowController(JustForTesting)
59 
60 - (NSTextView*)legalText;
61 - (NSButton*)updateButton;
62 - (NSTextField*)updateText;
63 
64 // Returns an NSAttributedString that contains locale-specific legal text.
65 + (NSAttributedString*)legalTextBlock;
66 
67 @end  // @interface AboutWindowController(JustForTesting)
68 
69 #endif  // CHROME_BROWSER_UI_COCOA_ABOUT_WINDOW_CONTROLLER_H_
70