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_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" | 14 #include "chrome/browser/ui/intents/web_intent_picker_delegate.h" |
15 #include "content/public/browser/notification_observer.h" | 15 #include "content/public/browser/notification_observer.h" |
16 #include "content/public/browser/notification_registrar.h" | 16 #include "content/public/browser/notification_registrar.h" |
17 #include "webkit/glue/web_intent_data.h" | 17 #include "webkit/glue/web_intent_data.h" |
18 | 18 |
19 class Browser; | 19 class Browser; |
20 class FaviconService; | 20 class FaviconService; |
21 class GURL; | 21 class GURL; |
22 class SkBitmap; | 22 class SkBitmap; |
23 class TabContentsWrapper; | 23 class TabContentsWrapper; |
24 class WebDataService; | 24 class WebDataService; |
25 class WebIntentPicker; | 25 class WebIntentPicker; |
26 class WebIntentPickerFactory; | 26 class WebIntentPickerFactory; |
| 27 |
| 28 namespace webkit_glue { |
27 struct WebIntentServiceData; | 29 struct WebIntentServiceData; |
| 30 } |
28 | 31 |
29 // Controls the creation of the WebIntentPicker UI and forwards the user's | 32 // Controls the creation of the WebIntentPicker UI and forwards the user's |
30 // intent handler choice back to the TabContents object. | 33 // intent handler choice back to the TabContents object. |
31 class WebIntentPickerController : public content::NotificationObserver, | 34 class WebIntentPickerController : public content::NotificationObserver, |
32 public WebIntentPickerDelegate { | 35 public WebIntentPickerDelegate { |
33 public: | 36 public: |
34 // Takes ownership of |factory|. | 37 // Takes ownership of |factory|. |
35 WebIntentPickerController(TabContentsWrapper* wrapper, | 38 WebIntentPickerController(TabContentsWrapper* wrapper, |
36 WebIntentPickerFactory* factory); | 39 WebIntentPickerFactory* factory); |
37 virtual ~WebIntentPickerController(); | 40 virtual ~WebIntentPickerController(); |
(...skipping 26 matching lines...) Expand all Loading... |
64 private: | 67 private: |
65 friend class WebIntentPickerControllerTest; | 68 friend class WebIntentPickerControllerTest; |
66 friend class WebIntentPickerControllerBrowserTest; | 69 friend class WebIntentPickerControllerBrowserTest; |
67 class WebIntentDataFetcher; | 70 class WebIntentDataFetcher; |
68 class FaviconFetcher; | 71 class FaviconFetcher; |
69 | 72 |
70 int pending_async_count() const { return pending_async_count_; } | 73 int pending_async_count() const { return pending_async_count_; } |
71 | 74 |
72 // Called from the WebIntentDataFetcher when intent data is available. | 75 // Called from the WebIntentDataFetcher when intent data is available. |
73 void OnWebIntentDataAvailable( | 76 void OnWebIntentDataAvailable( |
74 const std::vector<WebIntentServiceData>& intent_data); | 77 const std::vector<webkit_glue::WebIntentServiceData>& services); |
75 | 78 |
76 // Called from the FaviconDataFetcher when a favicon is available. | 79 // Called from the FaviconDataFetcher when a favicon is available. |
77 void OnFaviconDataAvailable(size_t index, const SkBitmap& icon_bitmap); | 80 void OnFaviconDataAvailable(size_t index, const SkBitmap& icon_bitmap); |
78 | 81 |
79 // Called from the FaviconDataFetcher when a favicon is not available. | 82 // Called from the FaviconDataFetcher when a favicon is not available. |
80 void OnFaviconDataUnavailable(size_t index); | 83 void OnFaviconDataUnavailable(size_t index); |
81 | 84 |
82 // Closes the currently active picker. | 85 // Closes the currently active picker. |
83 void ClosePicker(); | 86 void ClosePicker(); |
84 | 87 |
(...skipping 29 matching lines...) Expand all Loading... |
114 // The intent data from the client. | 117 // The intent data from the client. |
115 webkit_glue::WebIntentData intent_; | 118 webkit_glue::WebIntentData intent_; |
116 | 119 |
117 // The intent ID assigned to this intent by the renderer. | 120 // The intent ID assigned to this intent by the renderer. |
118 int intent_id_; | 121 int intent_id_; |
119 | 122 |
120 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController); | 123 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController); |
121 }; | 124 }; |
122 | 125 |
123 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ | 126 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ |
OLD | NEW |