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 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #import <Cocoa/Cocoa.h> | 11 #import <Cocoa/Cocoa.h> |
12 | 12 |
13 #include "base/memory/scoped_nsobject.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "chrome/browser/extensions/extension_install_ui.h" | 15 #include "chrome/browser/extensions/extension_install_ui.h" |
16 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
17 | 17 |
18 class Extension; | 18 class Extension; |
19 class Profile; | 19 class Profile; |
20 | 20 |
21 // A controller for dialog to let the user install an extension. Created by | 21 // A controller for dialog to let the user install an extension. Created by |
22 // CrxInstaller. | 22 // CrxInstaller. |
23 @interface ExtensionInstallDialogController : NSWindowController { | 23 @interface ExtensionInstallDialogController : NSWindowController { |
24 @private | 24 @private |
25 IBOutlet NSImageView* iconView_; | 25 IBOutlet NSImageView* iconView_; |
26 IBOutlet NSTextField* titleField_; | 26 IBOutlet NSTextField* titleField_; |
| 27 IBOutlet NSButton* cancelButton_; |
| 28 IBOutlet NSButton* okButton_; |
| 29 |
| 30 // Present only when the dialog has permission warnings to display. |
27 IBOutlet NSTextField* subtitleField_; | 31 IBOutlet NSTextField* subtitleField_; |
28 IBOutlet NSTextField* warningsField_; | 32 IBOutlet NSTextField* warningsField_; |
29 IBOutlet NSBox* warningsBox_; | 33 |
30 IBOutlet NSButton* cancelButton_; | 34 // Present only in the inline install dialog. |
31 IBOutlet NSButton* okButton_; | 35 IBOutlet NSBox* warningsSeparator_; // Only when there are permissions. |
| 36 IBOutlet NSView* ratingStars_; |
| 37 IBOutlet NSTextField* ratingCountField_; |
| 38 IBOutlet NSTextField* userCountField_; |
32 | 39 |
33 NSWindow* parentWindow_; // weak | 40 NSWindow* parentWindow_; // weak |
34 Profile* profile_; // weak | 41 Profile* profile_; // weak |
35 ExtensionInstallUI::Delegate* delegate_; // weak | 42 ExtensionInstallUI::Delegate* delegate_; // weak |
36 | 43 const Extension* extension_; // weak |
37 scoped_nsobject<NSString> title_; | 44 scoped_ptr<ExtensionInstallUI::Prompt> prompt_; |
38 scoped_nsobject<NSString> warnings_; | |
39 scoped_nsobject<NSString> button_; | |
40 scoped_nsobject<NSString> cancel_button_; | |
41 scoped_nsobject<NSString> subtitle_; | |
42 SkBitmap icon_; | 45 SkBitmap icon_; |
43 } | 46 } |
44 | 47 |
| 48 // For unit test use only |
45 @property(nonatomic, readonly) NSImageView* iconView; | 49 @property(nonatomic, readonly) NSImageView* iconView; |
46 @property(nonatomic, readonly) NSTextField* titleField; | 50 @property(nonatomic, readonly) NSTextField* titleField; |
47 @property(nonatomic, readonly) NSTextField* subtitleField; | 51 @property(nonatomic, readonly) NSTextField* subtitleField; |
48 @property(nonatomic, readonly) NSTextField* warningsField; | 52 @property(nonatomic, readonly) NSTextField* warningsField; |
49 @property(nonatomic, readonly) NSBox* warningsBox; | |
50 @property(nonatomic, readonly) NSButton* cancelButton; | 53 @property(nonatomic, readonly) NSButton* cancelButton; |
51 @property(nonatomic, readonly) NSButton* okButton; | 54 @property(nonatomic, readonly) NSButton* okButton; |
| 55 @property(nonatomic, readonly) NSBox* warningsSeparator; |
| 56 @property(nonatomic, readonly) NSView* ratingStars; |
| 57 @property(nonatomic, readonly) NSTextField* ratingCountField; |
| 58 @property(nonatomic, readonly) NSTextField* userCountField; |
52 | 59 |
53 - (id)initWithParentWindow:(NSWindow*)window | 60 - (id)initWithParentWindow:(NSWindow*)window |
54 profile:(Profile*)profile | 61 profile:(Profile*)profile |
55 extension:(const Extension*)extension | 62 extension:(const Extension*)extension |
56 delegate:(ExtensionInstallUI::Delegate*)delegate | 63 delegate:(ExtensionInstallUI::Delegate*)delegate |
57 icon:(SkBitmap*)bitmap | 64 icon:(SkBitmap*)bitmap |
58 prompt:(const ExtensionInstallUI::Prompt&)prompt; | 65 prompt:(const ExtensionInstallUI::Prompt&)prompt; |
59 - (void)runAsModalSheet; | 66 - (void)runAsModalSheet; |
| 67 - (IBAction)storeLinkClicked:(id)sender; // Callback for "View details" link. |
60 - (IBAction)cancel:(id)sender; | 68 - (IBAction)cancel:(id)sender; |
61 - (IBAction)ok:(id)sender; | 69 - (IBAction)ok:(id)sender; |
62 | 70 |
63 @end | 71 @end |
64 | 72 |
65 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLLE
R_H_ | 73 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLLE
R_H_ |
OLD | NEW |