| 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_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 | 11 |
| 12 class GURL; | 12 class GURL; |
| 13 class SkBitmap; | 13 class SkBitmap; |
| 14 class TabContents; | 14 class TabContentsWrapper; |
| 15 class WebIntentPickerDelegate; | 15 class WebIntentPickerDelegate; |
| 16 | 16 |
| 17 // Base class for the web intent picker dialog. | 17 // Base class for the web intent picker dialog. |
| 18 class WebIntentPicker { | 18 class WebIntentPicker { |
| 19 public: | 19 public: |
| 20 class Delegate; | 20 class Delegate; |
| 21 | 21 |
| 22 // Platform specific factory function. | 22 // Platform specific factory function. |
| 23 static WebIntentPicker* Create(TabContents* tab_contents, | 23 static WebIntentPicker* Create(TabContentsWrapper* wrapper, |
| 24 WebIntentPickerDelegate* delegate); | 24 WebIntentPickerDelegate* delegate); |
| 25 | 25 |
| 26 // Initalizes this picker with the |urls|. | 26 // Initalizes this picker with the |urls|. |
| 27 virtual void SetServiceURLs(const std::vector<GURL>& urls) = 0; | 27 virtual void SetServiceURLs(const std::vector<GURL>& urls) = 0; |
| 28 | 28 |
| 29 // Sets the icon for a service at |index|. | 29 // Sets the icon for a service at |index|. |
| 30 virtual void SetServiceIcon(size_t index, const SkBitmap& icon) = 0; | 30 virtual void SetServiceIcon(size_t index, const SkBitmap& icon) = 0; |
| 31 | 31 |
| 32 // Sets the icon for a service at |index| to be the default favicon. | 32 // Sets the icon for a service at |index| to be the default favicon. |
| 33 virtual void SetDefaultServiceIcon(size_t index) = 0; | 33 virtual void SetDefaultServiceIcon(size_t index) = 0; |
| 34 | 34 |
| 35 // Shows the UI for this picker. | 35 // Shows the UI for this picker. |
| 36 virtual void Show() = 0; | 36 virtual void Show() = 0; |
| 37 | 37 |
| 38 // Hides the UI for this picker, and destroys its UI. | 38 // Hides the UI for this picker, and destroys its UI. |
| 39 virtual void Close() = 0; | 39 virtual void Close() = 0; |
| 40 | 40 |
| 41 protected: | 41 protected: |
| 42 virtual ~WebIntentPicker() {} | 42 virtual ~WebIntentPicker() {} |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ | 45 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_H_ |
| OLD | NEW |