Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1283)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_install_view_controller.h

Issue 660643002: [Refactor] Move creating a browser if necessary to ExtensionInstallDialogView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_VIEW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_VIEW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_VIEW_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_VIEW_CONTROLLER_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/mac/scoped_nsobject.h" 12 #include "base/mac/scoped_nsobject.h"
13 #include "base/memory/ref_counted.h" 13 #include "base/memory/ref_counted.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/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 Profile;
19
18 namespace content { 20 namespace content {
19 class PageNavigator; 21 class PageNavigator;
20 } 22 }
21 23
22 // Displays the extension or bundle install prompt, and notifies the 24 // Displays the extension or bundle install prompt, and notifies the
23 // ExtensionInstallPrompt::Delegate of success or failure 25 // ExtensionInstallPrompt::Delegate of success or failure
24 @interface ExtensionInstallViewController : NSViewController 26 @interface ExtensionInstallViewController : NSViewController
25 <NSOutlineViewDataSource, 27 <NSOutlineViewDataSource,
26 NSOutlineViewDelegate> { 28 NSOutlineViewDelegate> {
27 IBOutlet NSImageView* iconView_; 29 IBOutlet NSImageView* iconView_;
28 IBOutlet NSTextField* titleField_; 30 IBOutlet NSTextField* titleField_;
29 IBOutlet NSTextField* itemsField_; 31 IBOutlet NSTextField* itemsField_;
30 IBOutlet NSButton* cancelButton_; 32 IBOutlet NSButton* cancelButton_;
31 IBOutlet NSButton* okButton_; 33 IBOutlet NSButton* okButton_;
32 34
33 // Present only when the dialog has permission warnings issues to display. 35 // Present only when the dialog has permission warnings issues to display.
34 IBOutlet NSOutlineView* outlineView_; 36 IBOutlet NSOutlineView* outlineView_;
35 37
36 // Present only in the install dialogs with webstore data (inline and 38 // Present only in the install dialogs with webstore data (inline and
37 // external). 39 // external).
38 IBOutlet NSBox* warningsSeparator_; // Only when there are permissions. 40 IBOutlet NSBox* warningsSeparator_; // Only when there are permissions.
39 IBOutlet NSView* ratingStars_; 41 IBOutlet NSView* ratingStars_;
40 IBOutlet NSTextField* ratingCountField_; 42 IBOutlet NSTextField* ratingCountField_;
41 IBOutlet NSTextField* userCountField_; 43 IBOutlet NSTextField* userCountField_;
42 IBOutlet NSButton* storeLinkButton_; 44 IBOutlet NSButton* storeLinkButton_;
43 45
46 Profile* profile_; // weak
44 content::PageNavigator* navigator_; // weak 47 content::PageNavigator* navigator_; // weak
45 ExtensionInstallPrompt::Delegate* delegate_; // weak 48 ExtensionInstallPrompt::Delegate* delegate_; // weak
46 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt_; 49 scoped_refptr<ExtensionInstallPrompt::Prompt> prompt_;
47 50
48 base::scoped_nsobject<NSArray> warnings_; 51 base::scoped_nsobject<NSArray> warnings_;
49 BOOL isComputingRowHeight_; 52 BOOL isComputingRowHeight_;
50 } 53 }
51 54
52 // For unit test use only. 55 // For unit test use only.
53 @property(nonatomic, readonly) NSImageView* iconView; 56 @property(nonatomic, readonly) NSImageView* iconView;
54 @property(nonatomic, readonly) NSTextField* titleField; 57 @property(nonatomic, readonly) NSTextField* titleField;
55 @property(nonatomic, readonly) NSTextField* itemsField; 58 @property(nonatomic, readonly) NSTextField* itemsField;
56 @property(nonatomic, readonly) NSButton* cancelButton; 59 @property(nonatomic, readonly) NSButton* cancelButton;
57 @property(nonatomic, readonly) NSButton* okButton; 60 @property(nonatomic, readonly) NSButton* okButton;
58 @property(nonatomic, readonly) NSOutlineView* outlineView; 61 @property(nonatomic, readonly) NSOutlineView* outlineView;
59 @property(nonatomic, readonly) NSBox* warningsSeparator; 62 @property(nonatomic, readonly) NSBox* warningsSeparator;
60 @property(nonatomic, readonly) NSView* ratingStars; 63 @property(nonatomic, readonly) NSView* ratingStars;
61 @property(nonatomic, readonly) NSTextField* ratingCountField; 64 @property(nonatomic, readonly) NSTextField* ratingCountField;
62 @property(nonatomic, readonly) NSTextField* userCountField; 65 @property(nonatomic, readonly) NSTextField* userCountField;
63 @property(nonatomic, readonly) NSButton* storeLinkButton; 66 @property(nonatomic, readonly) NSButton* storeLinkButton;
64 67
65 - (id)initWithNavigator:(content::PageNavigator*)navigator 68 - (id)initWithProfile:(Profile*)profile
66 delegate:(ExtensionInstallPrompt::Delegate*)delegate 69 navigator:(content::PageNavigator*)navigator
67 prompt:(scoped_refptr<ExtensionInstallPrompt::Prompt>)prompt; 70 delegate:(ExtensionInstallPrompt::Delegate*)delegate
71 prompt:(scoped_refptr<ExtensionInstallPrompt::Prompt>)prompt;
68 - (IBAction)storeLinkClicked:(id)sender; // Callback for "View details" link. 72 - (IBAction)storeLinkClicked:(id)sender; // Callback for "View details" link.
69 - (IBAction)cancel:(id)sender; 73 - (IBAction)cancel:(id)sender;
70 - (IBAction)ok:(id)sender; 74 - (IBAction)ok:(id)sender;
71 75
72 @end 76 @end
73 77
74 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_VIEW_CONTROLLER_ H_ 78 #endif // CHROME_BROWSER_UI_COCOA_EXTENSIONS_EXTENSION_INSTALL_VIEW_CONTROLLER_ H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698