| 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_BUBBLE_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_WEB_INTENT_BUBBLE_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_WEB_INTENT_BUBBLE_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_WEB_INTENT_BUBBLE_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 | 16 |
| 17 // Controller for intent picker bubble. This bubble pops up whenever a web | 17 // Controller for intent picker bubble. This bubble pops up whenever a web |
| 18 // page invokes ActivateIntent and lets the user choose which service should | 18 // page invokes ActivateIntent and lets the user choose which service should |
| 19 // be used to handle this action. | 19 // be used to handle this action. |
| 20 @interface WebIntentBubbleController : BaseBubbleController { | 20 @interface WebIntentBubbleController : BaseBubbleController { |
| 21 @private | 21 @private |
| 22 // Images for all icons shown in bubble. | 22 // Images for all icons shown in bubble. |
| 23 scoped_nsobject<NSPointerArray> iconImages_; | 23 scoped_nsobject<NSPointerArray> iconImages_; |
| 24 | 24 |
| 25 // URLs associated with the individual services. | 25 // URLs associated with the individual services. |
| 26 scoped_nsobject<NSArray> serviceURLs_; | 26 scoped_nsobject<NSArray> serviceURLs_; |
| 27 | 27 |
| 28 // Default icon to use if no icon is specified. | |
| 29 scoped_nsobject<NSImage> defaultIcon_; | |
| 30 | |
| 31 // C++ <-> ObjectiveC bridge. Weak reference. | 28 // C++ <-> ObjectiveC bridge. Weak reference. |
| 32 WebIntentPickerCocoa* picker_; | 29 WebIntentPickerCocoa* picker_; |
| 33 | 30 |
| 34 // Inline disposition tab contents. Weak reference. | 31 // Inline disposition tab contents. Weak reference. |
| 35 TabContentsWrapper* contents_; | 32 TabContentsWrapper* contents_; |
| 36 } | 33 } |
| 37 | 34 |
| 38 // Initialize the window, and connect to bridge. | 35 // Initialize the window, and connect to bridge. |
| 39 - (id)initWithPicker:(WebIntentPickerCocoa*)picker | 36 - (id)initWithPicker:(WebIntentPickerCocoa*)picker |
| 40 parentWindow:(NSWindow*)parent | 37 parentWindow:(NSWindow*)parent |
| 41 anchoredAt:(NSPoint)point; | 38 anchoredAt:(NSPoint)point; |
| 42 | 39 |
| 43 // Replaces the |image| for service at |index|. | 40 // Replaces the |image| for service at |index|. |
| 44 - (void)replaceImageAtIndex:(size_t)index withImage:(NSImage*)image; | 41 - (void)replaceImageAtIndex:(size_t)index withImage:(NSImage*)image; |
| 45 | 42 |
| 46 // Set the service |urls| for all services. | 43 // Set the service |urls| for all services. |
| 47 - (void)setServiceURLs:(NSArray*)urls; | 44 - (void)setServiceURLs:(NSArray*)urls; |
| 48 | 45 |
| 49 // Set the contents for inline disposition intents. | 46 // Set the contents for inline disposition intents. |
| 50 - (void)setInlineDispositionTabContents:(TabContentsWrapper*)wrapper; | 47 - (void)setInlineDispositionTabContents:(TabContentsWrapper*)wrapper; |
| 51 | 48 |
| 52 @end // WebIntentBubbleController | 49 @end // WebIntentBubbleController |
| 53 | 50 |
| 54 #endif // CHROME_BROWSER_UI_COCOA_WEB_INTENT_BUBBLE_CONTROLLER_H_ | 51 #endif // CHROME_BROWSER_UI_COCOA_WEB_INTENT_BUBBLE_CONTROLLER_H_ |
| OLD | NEW |