| OLD | NEW |
| 1 // Copyright (c) 2011 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_INTENTS_WEB_INTENT_PICKER_H_ | 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ |
| 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ | 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <vector> | 10 #include <vector> |
| 11 #include "base/string16.h" |
| 11 | 12 |
| 12 class Browser; | 13 class Browser; |
| 13 class GURL; | |
| 14 class SkBitmap; | |
| 15 class TabContentsWrapper; | 14 class TabContentsWrapper; |
| 16 class WebIntentPickerDelegate; | 15 class WebIntentPickerDelegate; |
| 16 class WebIntentPickerModel; |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 class WebContents; | 19 class WebContents; |
| 20 } | 20 } |
| 21 | 21 |
| 22 // Base class for the web intent picker dialog. | 22 // Base class for the web intent picker dialog. |
| 23 class WebIntentPicker { | 23 class WebIntentPicker { |
| 24 public: | 24 public: |
| 25 class Delegate; | |
| 26 | |
| 27 // Platform specific factory function. This function will automatically show | 25 // Platform specific factory function. This function will automatically show |
| 28 // the picker. | 26 // the picker. |
| 29 static WebIntentPicker* Create(Browser* browser, | 27 static WebIntentPicker* Create(Browser* browser, |
| 30 TabContentsWrapper* wrapper, | 28 TabContentsWrapper* wrapper, |
| 31 WebIntentPickerDelegate* delegate); | 29 WebIntentPickerDelegate* delegate, |
| 32 | 30 WebIntentPickerModel* model); |
| 33 // Initalizes this picker with the |urls|. | |
| 34 virtual void SetServiceURLs(const std::vector<GURL>& urls) = 0; | |
| 35 | |
| 36 // Sets the icon for a service at |index|. | |
| 37 virtual void SetServiceIcon(size_t index, const SkBitmap& icon) = 0; | |
| 38 | |
| 39 // Sets the icon for a service at |index| to be the default favicon. | |
| 40 virtual void SetDefaultServiceIcon(size_t index) = 0; | |
| 41 | 31 |
| 42 // Hides the UI for this picker, and destroys its UI. | 32 // Hides the UI for this picker, and destroys its UI. |
| 43 virtual void Close() = 0; | 33 virtual void Close() = 0; |
| 44 | 34 |
| 45 // Show the inline disposition UI for the given URL. | 35 // Called when the controller has finished all pending asynchronous |
| 46 virtual content::WebContents* SetInlineDisposition(const GURL& url) = 0; | 36 // activities. |
| 37 virtual void OnPendingAsyncCompleted() {} |
| 47 | 38 |
| 48 protected: | 39 protected: |
| 49 virtual ~WebIntentPicker() {} | 40 virtual ~WebIntentPicker() {} |
| 50 }; | 41 }; |
| 51 | 42 |
| 52 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ | 43 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ |
| OLD | NEW |