OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_UI_COCOA_WEB_INTENT_SHEET_CONTROLLER_H_ | |
6 #define CHROME_BROWSER_UI_COCOA_WEB_INTENT_SHEET_CONTROLLER_H_ | |
7 | |
8 #import <Cocoa/Cocoa.h> | |
9 | |
10 #include "base/memory/scoped_nsobject.h" | |
11 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" | |
12 #include "chrome/browser/ui/intents/web_intent_picker.h" | |
13 | |
14 class WebIntentPickerCocoa; | |
15 class WebIntentPickerModel; | |
16 | |
17 @class IntentView; | |
18 @class WaitingView; | |
19 | |
20 namespace content { | |
21 class WebContents; | |
22 } | |
23 | |
24 // Controller for intent picker constrained dialog. This dialog pops up | |
25 // whenever a web page invokes ActivateIntent and lets the user choose which | |
26 // service should be used to handle this action. | |
27 @interface WebIntentPickerSheetController : NSWindowController { | |
28 @private | |
29 // C++ <-> ObjectiveC bridge. Weak reference. | |
30 WebIntentPickerCocoa* picker_; | |
31 | |
32 // Inline disposition web contents. Weak reference. | |
33 content::WebContents* webContents_; | |
34 | |
35 // The intent picker data to be rendered. Weak reference. | |
36 WebIntentPickerModel* model_; | |
37 | |
38 scoped_nsobject<WaitingView> waitingView_; | |
39 scoped_nsobject<NSTextField> actionTextField_; | |
40 scoped_nsobject<IntentView> intentView_; | |
41 scoped_nsobject<NSButton> closeButton_; | |
42 scoped_nsobject<NSView> flipView_; | |
43 scoped_nsobject<NSTextField> inlineDispositionTitleField_; | |
44 } | |
45 - (IBAction)installExtension:(id)sender; | |
46 | |
47 // Initialize the constrained dialog, and connect to picker. | |
48 - (id)initWithPicker:(WebIntentPickerCocoa*)picker; | |
49 | |
50 // Set the contents for inline disposition intents. | |
51 - (void)setInlineDispositionWebContents:(content::WebContents*)webContents; | |
52 | |
53 // Set the size of the inline disposition view. | |
54 - (void)setInlineDispositionFrameSize:(NSSize)size; | |
55 | |
56 - (void)performLayoutWithModel:(WebIntentPickerModel*)model; | |
57 | |
58 // Sets the action string of the picker, e.g., | |
59 // "Which service should be used for sharing?". | |
60 - (void)setActionString:(NSString*)actionString; | |
61 | |
62 // Sets the service title for inline disposition. | |
63 - (void)setInlineDispositionTitle:(NSString*)title; | |
64 | |
65 // Stop displaying throbber. Called when extension isntallation is complete. | |
66 - (void)stopThrobber; | |
67 | |
68 // Close the current sheet (and by extension, the constrained dialog). | |
69 - (void)closeSheet; | |
70 | |
71 // Notification handler - called when sheet has been closed. | |
72 - (void)sheetDidEnd:(NSWindow*)sheet | |
73 returnCode:(int)returnCode | |
74 contextInfo:(void*)contextInfo; | |
75 @end // WebIntentPickerSheetController | |
76 | |
77 #endif // CHROME_BROWSER_UI_COCOA_WEB_INTENT_SHEET_CONTROLLER_H_ | |
OLD | NEW |