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_INTENTS_WEB_INTENT_PICKER_VIEW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_VIEW_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_VIEW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_VIEW_CONTROLLER_H_ |
7 | 7 |
8 #import <Cocoa/Cocoa.h> | 8 #import <Cocoa/Cocoa.h> |
9 | 9 |
10 #include "base/memory/scoped_nsobject.h" | 10 #include "base/memory/scoped_nsobject.h" |
11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
12 | 12 |
13 class WebIntentPickerCocoa2; | 13 class WebIntentPickerCocoa; |
14 @class WebIntentChooseServiceViewController; | 14 @class WebIntentChooseServiceViewController; |
15 @class WebIntentExtensionPromptViewController; | 15 @class WebIntentExtensionPromptViewController; |
16 @class WebIntentInlineServiceViewController; | 16 @class WebIntentInlineServiceViewController; |
17 @class WebIntentMessageViewController; | 17 @class WebIntentMessageViewController; |
18 @class WebIntentProgressViewController; | 18 @class WebIntentProgressViewController; |
19 | 19 |
20 // The different states a picker dialog can be in. | 20 // The different states a picker dialog can be in. |
21 enum WebIntentPickerState { | 21 enum WebIntentPickerState { |
22 PICKER_STATE_WAITING, | 22 PICKER_STATE_WAITING, |
23 PICKER_STATE_NO_SERVICE, | 23 PICKER_STATE_NO_SERVICE, |
24 PICKER_STATE_CHOOSE_SERVICE, | 24 PICKER_STATE_CHOOSE_SERVICE, |
25 PICKER_STATE_INLINE_SERVICE, | 25 PICKER_STATE_INLINE_SERVICE, |
26 PICKER_STATE_INSTALLING_EXTENSION, | 26 PICKER_STATE_INSTALLING_EXTENSION, |
27 PICKER_STATE_EXTENSION_PROMPT | 27 PICKER_STATE_EXTENSION_PROMPT |
28 }; | 28 }; |
29 | 29 |
30 // Manages the web intent picker UI. The view is meant to be embedded in either | 30 // Manages the web intent picker UI. The view is meant to be embedded in either |
31 // a constrained window or a bubble. | 31 // a constrained window or a bubble. |
32 @interface WebIntentPickerViewController : NSViewController { | 32 @interface WebIntentPickerViewController : NSViewController { |
33 @private | 33 @private |
34 WebIntentPickerCocoa2* picker_; // weak | 34 WebIntentPickerCocoa* picker_; // weak |
35 WebIntentPickerState state_; | 35 WebIntentPickerState state_; |
36 scoped_nsobject<NSButton> closeButton_; | 36 scoped_nsobject<NSButton> closeButton_; |
37 scoped_nsobject<WebIntentChooseServiceViewController> | 37 scoped_nsobject<WebIntentChooseServiceViewController> |
38 chooseServiceViewController_; | 38 chooseServiceViewController_; |
39 scoped_nsobject<WebIntentInlineServiceViewController> | 39 scoped_nsobject<WebIntentInlineServiceViewController> |
40 inlineServiceViewController_; | 40 inlineServiceViewController_; |
41 scoped_nsobject<WebIntentMessageViewController> | 41 scoped_nsobject<WebIntentMessageViewController> |
42 messageViewController_; | 42 messageViewController_; |
43 scoped_nsobject<WebIntentProgressViewController> | 43 scoped_nsobject<WebIntentProgressViewController> |
44 progressViewController_; | 44 progressViewController_; |
45 scoped_nsobject<WebIntentExtensionPromptViewController> | 45 scoped_nsobject<WebIntentExtensionPromptViewController> |
46 extensionPromptViewController_; | 46 extensionPromptViewController_; |
47 } | 47 } |
48 | 48 |
49 - (id)initWithPicker:(WebIntentPickerCocoa2*)picker; | 49 - (id)initWithPicker:(WebIntentPickerCocoa*)picker; |
50 | 50 |
51 // Gets the minimum size of the web view shown inside picker dialog. | 51 // Gets the minimum size of the web view shown inside picker dialog. |
52 - (gfx::Size)minimumInlineWebViewSize; | 52 - (gfx::Size)minimumInlineWebViewSize; |
53 | 53 |
54 - (NSButton*)closeButton; | 54 - (NSButton*)closeButton; |
55 | 55 |
56 // Get the current state. | 56 // Get the current state. |
57 - (WebIntentPickerState)state; | 57 - (WebIntentPickerState)state; |
58 | 58 |
59 - (WebIntentChooseServiceViewController*)chooseServiceViewController; | 59 - (WebIntentChooseServiceViewController*)chooseServiceViewController; |
60 - (WebIntentInlineServiceViewController*)inlineServiceViewController; | 60 - (WebIntentInlineServiceViewController*)inlineServiceViewController; |
61 - (WebIntentMessageViewController*)messageViewController; | 61 - (WebIntentMessageViewController*)messageViewController; |
62 - (WebIntentProgressViewController*)progressViewController; | 62 - (WebIntentProgressViewController*)progressViewController; |
63 - (WebIntentExtensionPromptViewController*)extensionPromptViewController; | 63 - (WebIntentExtensionPromptViewController*)extensionPromptViewController; |
64 | 64 |
65 // Update the dialog state and perform layout. | 65 // Update the dialog state and perform layout. |
66 - (void)update; | 66 - (void)update; |
67 | 67 |
68 @end | 68 @end |
69 | 69 |
70 #endif // CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_VIEW_CONTROLLER_H_ | 70 #endif // CHROME_BROWSER_UI_COCOA_INTENTS_WEB_INTENT_PICKER_VIEW_CONTROLLER_H_ |
OLD | NEW |