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