OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #import <Cocoa/Cocoa.h> | 10 #import <Cocoa/Cocoa.h> |
11 | 11 |
12 #include "base/memory/scoped_nsobject.h" | |
12 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
13 #include "base/string16.h" | 14 #include "base/string16.h" |
14 #include "chrome/browser/extensions/extension_install_prompt.h" | 15 #include "chrome/browser/extensions/extension_install_prompt.h" |
15 #include "ui/gfx/image/image_skia.h" | 16 #include "ui/gfx/image/image_skia.h" |
16 | 17 |
17 namespace content { | 18 namespace content { |
18 class PageNavigator; | 19 class PageNavigator; |
19 } | 20 } |
20 | 21 |
21 // Displays the extension or bundle install prompt, and notifies the | 22 // Displays the extension or bundle install prompt, and notifies the |
22 // ExtensionInstallPrompt::Delegate of success or failure. | 23 // ExtensionInstallPrompt::Delegate of success or failure. |
23 @interface ExtensionInstallDialogController : NSWindowController { | 24 @interface ExtensionInstallDialogController : NSWindowController |
25 <NSOutlineViewDataSource, | |
26 NSOutlineViewDelegate> { | |
24 @private | 27 @private |
25 IBOutlet NSImageView* iconView_; | 28 IBOutlet NSImageView* iconView_; |
26 IBOutlet NSTextField* titleField_; | 29 IBOutlet NSTextField* titleField_; |
27 IBOutlet NSTextField* itemsField_; | 30 IBOutlet NSTextField* itemsField_; |
28 IBOutlet NSButton* cancelButton_; | 31 IBOutlet NSButton* cancelButton_; |
29 IBOutlet NSButton* okButton_; | 32 IBOutlet NSButton* okButton_; |
30 | 33 |
31 // Present only when the dialog has permission warnings to display. | 34 // Present only when the dialog has permission warnings or OAuth issues to |
32 IBOutlet NSTextField* subtitleField_; | 35 // display. |
33 IBOutlet NSTextField* warningsField_; | 36 IBOutlet NSOutlineView* outlineView_; |
34 | 37 |
35 // Present only in the inline install dialog. | 38 // Present only in the inline install dialog. |
36 IBOutlet NSBox* warningsSeparator_; // Only when there are permissions. | 39 IBOutlet NSBox* warningsSeparator_; // Only when there are permissions. |
37 IBOutlet NSView* ratingStars_; | 40 IBOutlet NSView* ratingStars_; |
38 IBOutlet NSTextField* ratingCountField_; | 41 IBOutlet NSTextField* ratingCountField_; |
39 IBOutlet NSTextField* userCountField_; | 42 IBOutlet NSTextField* userCountField_; |
40 | 43 |
41 NSWindow* parentWindow_; // weak | 44 NSWindow* parentWindow_; // weak |
42 content::PageNavigator* navigator_; // weak | 45 content::PageNavigator* navigator_; // weak |
43 ExtensionInstallPrompt::Delegate* delegate_; // weak | 46 ExtensionInstallPrompt::Delegate* delegate_; // weak |
44 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt_; | 47 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt_; |
48 | |
49 scoped_nsobject<NSArray> warnings_; | |
50 BOOL isComputingRowHeight; | |
Robert Sesek
2012/08/06 21:31:48
nit: trailing _
sail
2012/08/09 02:00:29
Done.
| |
45 } | 51 } |
46 | 52 |
47 // For unit test use only | 53 // For unit test use only |
48 @property(nonatomic, readonly) NSImageView* iconView; | 54 @property(nonatomic, readonly) NSImageView* iconView; |
49 @property(nonatomic, readonly) NSTextField* titleField; | 55 @property(nonatomic, readonly) NSTextField* titleField; |
50 @property(nonatomic, readonly) NSTextField* itemsField; | 56 @property(nonatomic, readonly) NSTextField* itemsField; |
51 @property(nonatomic, readonly) NSTextField* subtitleField; | |
52 @property(nonatomic, readonly) NSTextField* warningsField; | |
53 @property(nonatomic, readonly) NSButton* cancelButton; | 57 @property(nonatomic, readonly) NSButton* cancelButton; |
54 @property(nonatomic, readonly) NSButton* okButton; | 58 @property(nonatomic, readonly) NSButton* okButton; |
59 @property(nonatomic, readonly) NSOutlineView* outlineView; | |
55 @property(nonatomic, readonly) NSBox* warningsSeparator; | 60 @property(nonatomic, readonly) NSBox* warningsSeparator; |
56 @property(nonatomic, readonly) NSView* ratingStars; | 61 @property(nonatomic, readonly) NSView* ratingStars; |
57 @property(nonatomic, readonly) NSTextField* ratingCountField; | 62 @property(nonatomic, readonly) NSTextField* ratingCountField; |
58 @property(nonatomic, readonly) NSTextField* userCountField; | 63 @property(nonatomic, readonly) NSTextField* userCountField; |
59 | 64 |
60 - (id)initWithParentWindow:(NSWindow*)window | 65 - (id)initWithParentWindow:(NSWindow*)window |
61 navigator:(content::PageNavigator*)navigator | 66 navigator:(content::PageNavigator*)navigator |
62 delegate:(ExtensionInstallPrompt::Delegate*)delegate | 67 delegate:(ExtensionInstallPrompt::Delegate*)delegate |
63 prompt:(const ExtensionInstallPrompt::Prompt&)prompt; | 68 prompt:(const ExtensionInstallPrompt::Prompt&)prompt; |
64 - (void)runAsModalSheet; | 69 - (void)runAsModalSheet; |
65 - (IBAction)storeLinkClicked:(id)sender; // Callback for "View details" link. | 70 - (IBAction)storeLinkClicked:(id)sender; // Callback for "View details" link. |
66 - (IBAction)cancel:(id)sender; | 71 - (IBAction)cancel:(id)sender; |
67 - (IBAction)ok:(id)sender; | 72 - (IBAction)ok:(id)sender; |
68 | 73 |
69 @end | 74 @end |
70 | 75 |
71 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLLE R_H_ | 76 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLLE R_H_ |
OLD | NEW |