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_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 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // extensions::WebstoreInstaller::Delegate implementation. | 87 // extensions::WebstoreInstaller::Delegate implementation. |
88 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; | 88 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; |
89 virtual void OnExtensionInstallFailure(const std::string& id, | 89 virtual void OnExtensionInstallFailure(const std::string& id, |
90 const std::string& error) OVERRIDE; | 90 const std::string& error) OVERRIDE; |
91 | 91 |
92 private: | 92 private: |
93 friend class WebIntentPickerControllerTest; | 93 friend class WebIntentPickerControllerTest; |
94 friend class WebIntentPickerControllerBrowserTest; | 94 friend class WebIntentPickerControllerBrowserTest; |
95 friend class WebIntentPickerControllerIncognitoBrowserTest; | 95 friend class WebIntentPickerControllerIncognitoBrowserTest; |
96 | 96 |
| 97 // Dispatches intent to a just-installed extension with ID |extension_id|. |
| 98 void DispatchToInstalledExtension(const std::string& extension_id); |
| 99 |
97 // Adds a service to the data model. | 100 // Adds a service to the data model. |
98 void AddServiceToModel(const webkit_glue::WebIntentServiceData& service); | 101 void AddServiceToModel(const webkit_glue::WebIntentServiceData& service); |
99 | 102 |
100 // Gets a notification when the return message is sent to the source tab, | 103 // Gets a notification when the return message is sent to the source tab, |
101 // so we can close the picker dialog or service tab. | 104 // so we can close the picker dialog or service tab. |
102 void OnSendReturnMessage(webkit_glue::WebIntentReplyType reply_type); | 105 void OnSendReturnMessage(webkit_glue::WebIntentReplyType reply_type); |
103 | 106 |
104 // Exposed for tests only. | 107 // Exposed for tests only. |
105 void set_picker(WebIntentPicker* picker) { picker_ = picker; } | 108 void set_picker(WebIntentPicker* picker) { picker_ = picker; } |
106 | 109 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 const ExtensionIconAvailableCallback& callback, | 164 const ExtensionIconAvailableCallback& callback, |
162 const base::Closure& unavailable_callback); | 165 const base::Closure& unavailable_callback); |
163 | 166 |
164 // Called when an extension's icon is successfully decoded and resized. | 167 // Called when an extension's icon is successfully decoded and resized. |
165 void OnExtensionIconAvailable(const string16& extension_id, | 168 void OnExtensionIconAvailable(const string16& extension_id, |
166 const gfx::Image& icon_image); | 169 const gfx::Image& icon_image); |
167 | 170 |
168 // Called when an extension's icon failed to be decoded or resized. | 171 // Called when an extension's icon failed to be decoded or resized. |
169 void OnExtensionIconUnavailable(const string16& extension_id); | 172 void OnExtensionIconUnavailable(const string16& extension_id); |
170 | 173 |
171 // When an extension is installed, all that is known is the extension id. | |
172 // This callback receives the intent service data for that extension. | |
173 // |services| must be a non-empty list. | |
174 void OnExtensionInstallServiceAvailable( | |
175 const std::vector<webkit_glue::WebIntentServiceData>& services); | |
176 | |
177 // Decrements the |pending_async_count_| and notifies the picker if it | 174 // Decrements the |pending_async_count_| and notifies the picker if it |
178 // reaches zero. | 175 // reaches zero. |
179 void AsyncOperationFinished(); | 176 void AsyncOperationFinished(); |
180 | 177 |
181 // Helper to create picker dialog UI. | 178 // Helper to create picker dialog UI. |
182 void CreatePicker(); | 179 void CreatePicker(); |
183 | 180 |
184 // Closes the currently active picker. | 181 // Closes the currently active picker. |
185 void ClosePicker(); | 182 void ClosePicker(); |
186 | 183 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 226 |
230 // Request consumer used when asynchronously loading favicons. | 227 // Request consumer used when asynchronously loading favicons. |
231 CancelableRequestConsumerTSimple<size_t> favicon_consumer_; | 228 CancelableRequestConsumerTSimple<size_t> favicon_consumer_; |
232 | 229 |
233 base::WeakPtrFactory<WebIntentPickerController> weak_ptr_factory_; | 230 base::WeakPtrFactory<WebIntentPickerController> weak_ptr_factory_; |
234 | 231 |
235 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController); | 232 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController); |
236 }; | 233 }; |
237 | 234 |
238 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ | 235 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ |
OLD | NEW |