| 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 #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_ptr.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_prompt.h" | 15 #include "chrome/browser/extensions/extension_install_prompt.h" |
| 16 #include "ui/gfx/image/image_skia.h" | 16 #include "ui/gfx/image/image_skia.h" |
| 17 | 17 |
| 18 class Browser; | 18 namespace content { |
| 19 class PageNavigator; |
| 20 } |
| 19 | 21 |
| 20 // Displays the extension or bundle install prompt, and notifies the | 22 // Displays the extension or bundle install prompt, and notifies the |
| 21 // ExtensionInstallPrompt::Delegate of success or failure. | 23 // ExtensionInstallPrompt::Delegate of success or failure. |
| 22 @interface ExtensionInstallDialogController : NSWindowController { | 24 @interface ExtensionInstallDialogController : NSWindowController { |
| 23 @private | 25 @private |
| 24 IBOutlet NSImageView* iconView_; | 26 IBOutlet NSImageView* iconView_; |
| 25 IBOutlet NSTextField* titleField_; | 27 IBOutlet NSTextField* titleField_; |
| 26 IBOutlet NSTextField* itemsField_; | 28 IBOutlet NSTextField* itemsField_; |
| 27 IBOutlet NSButton* cancelButton_; | 29 IBOutlet NSButton* cancelButton_; |
| 28 IBOutlet NSButton* okButton_; | 30 IBOutlet NSButton* okButton_; |
| 29 | 31 |
| 30 // Present only when the dialog has permission warnings to display. | 32 // Present only when the dialog has permission warnings to display. |
| 31 IBOutlet NSTextField* subtitleField_; | 33 IBOutlet NSTextField* subtitleField_; |
| 32 IBOutlet NSTextField* warningsField_; | 34 IBOutlet NSTextField* warningsField_; |
| 33 | 35 |
| 34 // Present only in the inline install dialog. | 36 // Present only in the inline install dialog. |
| 35 IBOutlet NSBox* warningsSeparator_; // Only when there are permissions. | 37 IBOutlet NSBox* warningsSeparator_; // Only when there are permissions. |
| 36 IBOutlet NSView* ratingStars_; | 38 IBOutlet NSView* ratingStars_; |
| 37 IBOutlet NSTextField* ratingCountField_; | 39 IBOutlet NSTextField* ratingCountField_; |
| 38 IBOutlet NSTextField* userCountField_; | 40 IBOutlet NSTextField* userCountField_; |
| 39 | 41 |
| 40 NSWindow* parentWindow_; // weak | 42 NSWindow* parentWindow_; // weak |
| 41 Browser* browser_; // weak | 43 content::PageNavigator* navigator_; // weak |
| 42 ExtensionInstallPrompt::Delegate* delegate_; // weak | 44 ExtensionInstallPrompt::Delegate* delegate_; // weak |
| 43 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt_; | 45 scoped_ptr<ExtensionInstallPrompt::Prompt> prompt_; |
| 44 } | 46 } |
| 45 | 47 |
| 46 // For unit test use only | 48 // For unit test use only |
| 47 @property(nonatomic, readonly) NSImageView* iconView; | 49 @property(nonatomic, readonly) NSImageView* iconView; |
| 48 @property(nonatomic, readonly) NSTextField* titleField; | 50 @property(nonatomic, readonly) NSTextField* titleField; |
| 49 @property(nonatomic, readonly) NSTextField* itemsField; | 51 @property(nonatomic, readonly) NSTextField* itemsField; |
| 50 @property(nonatomic, readonly) NSTextField* subtitleField; | 52 @property(nonatomic, readonly) NSTextField* subtitleField; |
| 51 @property(nonatomic, readonly) NSTextField* warningsField; | 53 @property(nonatomic, readonly) NSTextField* warningsField; |
| 52 @property(nonatomic, readonly) NSButton* cancelButton; | 54 @property(nonatomic, readonly) NSButton* cancelButton; |
| 53 @property(nonatomic, readonly) NSButton* okButton; | 55 @property(nonatomic, readonly) NSButton* okButton; |
| 54 @property(nonatomic, readonly) NSBox* warningsSeparator; | 56 @property(nonatomic, readonly) NSBox* warningsSeparator; |
| 55 @property(nonatomic, readonly) NSView* ratingStars; | 57 @property(nonatomic, readonly) NSView* ratingStars; |
| 56 @property(nonatomic, readonly) NSTextField* ratingCountField; | 58 @property(nonatomic, readonly) NSTextField* ratingCountField; |
| 57 @property(nonatomic, readonly) NSTextField* userCountField; | 59 @property(nonatomic, readonly) NSTextField* userCountField; |
| 58 | 60 |
| 59 - (id)initWithParentWindow:(NSWindow*)window | 61 - (id)initWithParentWindow:(NSWindow*)window |
| 60 browser:(Browser*)browser | 62 navigator:(content::PageNavigator*)navigator |
| 61 delegate:(ExtensionInstallPrompt::Delegate*)delegate | 63 delegate:(ExtensionInstallPrompt::Delegate*)delegate |
| 62 prompt:(const ExtensionInstallPrompt::Prompt&)prompt; | 64 prompt:(const ExtensionInstallPrompt::Prompt&)prompt; |
| 63 - (void)runAsModalSheet; | 65 - (void)runAsModalSheet; |
| 64 - (IBAction)storeLinkClicked:(id)sender; // Callback for "View details" link. | 66 - (IBAction)storeLinkClicked:(id)sender; // Callback for "View details" link. |
| 65 - (IBAction)cancel:(id)sender; | 67 - (IBAction)cancel:(id)sender; |
| 66 - (IBAction)ok:(id)sender; | 68 - (IBAction)ok:(id)sender; |
| 67 | 69 |
| 68 @end | 70 @end |
| 69 | 71 |
| 70 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLLE
R_H_ | 72 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_DIALOG_CONTROLLE
R_H_ |
| OLD | NEW |