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