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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 virtual void OnExtensionLinkClicked( | 106 virtual void OnExtensionLinkClicked( |
107 const std::string& id, | 107 const std::string& id, |
108 WindowOpenDisposition disposition) OVERRIDE; | 108 WindowOpenDisposition disposition) OVERRIDE; |
109 virtual void OnSuggestionsLinkClicked( | 109 virtual void OnSuggestionsLinkClicked( |
110 WindowOpenDisposition disposition) OVERRIDE; | 110 WindowOpenDisposition disposition) OVERRIDE; |
111 virtual void OnUserCancelledPickerDialog() OVERRIDE; | 111 virtual void OnUserCancelledPickerDialog() OVERRIDE; |
112 virtual void OnChooseAnotherService() OVERRIDE; | 112 virtual void OnChooseAnotherService() OVERRIDE; |
113 virtual void OnClosing() OVERRIDE; | 113 virtual void OnClosing() OVERRIDE; |
114 | 114 |
115 // extensions::WebstoreInstaller::Delegate implementation. | 115 // extensions::WebstoreInstaller::Delegate implementation. |
| 116 virtual void OnExtensionDownloadStarted(const std::string& id, |
| 117 content::DownloadItem* item) OVERRIDE; |
| 118 virtual void OnExtensionDownloadProgress( |
| 119 const std::string& id, |
| 120 content::DownloadItem* item) OVERRIDE; |
116 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; | 121 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; |
117 virtual void OnExtensionInstallFailure(const std::string& id, | 122 virtual void OnExtensionInstallFailure(const std::string& id, |
118 const std::string& error) OVERRIDE; | 123 const std::string& error, |
| 124 bool cancelled) OVERRIDE; |
119 | 125 |
120 private: | 126 private: |
121 friend class WebIntentPickerControllerTest; | 127 friend class WebIntentPickerControllerTest; |
122 friend class WebIntentPickerControllerBrowserTest; | 128 friend class WebIntentPickerControllerBrowserTest; |
123 friend class WebIntentPickerControllerIncognitoBrowserTest; | 129 friend class WebIntentPickerControllerIncognitoBrowserTest; |
124 friend class WebIntentsButtonDecorationTest; | 130 friend class WebIntentsButtonDecorationTest; |
125 | 131 |
126 // Forward declaraton of the internal implementation class. | 132 // Forward declaraton of the internal implementation class. |
127 class UMAReporter; | 133 class UMAReporter; |
128 | 134 |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 void ClosePicker(); | 243 void ClosePicker(); |
238 | 244 |
239 // Re-starts the process of showing the dialog, suppressing any default | 245 // Re-starts the process of showing the dialog, suppressing any default |
240 // queries. Called on the user clicking Use-Another-Service. | 246 // queries. Called on the user clicking Use-Another-Service. |
241 void ReshowDialog(); | 247 void ReshowDialog(); |
242 | 248 |
243 // Delegate for ShowDialog and ReshowDialog. Starts all the data queries for | 249 // Delegate for ShowDialog and ReshowDialog. Starts all the data queries for |
244 // loading the picker model and showing the dialog. | 250 // loading the picker model and showing the dialog. |
245 void ShowDialog(bool suppress_defaults); | 251 void ShowDialog(bool suppress_defaults); |
246 | 252 |
| 253 // Update the download progress and status string. |
| 254 void UpdateDownloadState(const std::string& id, content::DownloadItem* item); |
| 255 |
| 256 // Cancel a pending download if any. |
| 257 void CancelDownload(); |
| 258 |
247 WebIntentPickerState dialog_state_; // Current state of the dialog. | 259 WebIntentPickerState dialog_state_; // Current state of the dialog. |
248 | 260 |
249 // A weak pointer to the tab contents that the picker is displayed on. | 261 // A weak pointer to the tab contents that the picker is displayed on. |
250 TabContents* tab_contents_; | 262 TabContents* tab_contents_; |
251 | 263 |
252 // A notification registrar, listening for notifications when the tab closes | 264 // A notification registrar, listening for notifications when the tab closes |
253 // to close the picker ui. | 265 // to close the picker ui. |
254 content::NotificationRegistrar registrar_; | 266 content::NotificationRegistrar registrar_; |
255 | 267 |
256 // A weak pointer to the picker this controller controls. | 268 // A weak pointer to the picker this controller controls. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // Weak pointers for the dispatcher OnSendReturnMessage will not be | 329 // Weak pointers for the dispatcher OnSendReturnMessage will not be |
318 // cancelled on picker close. | 330 // cancelled on picker close. |
319 base::WeakPtrFactory<WebIntentPickerController> dispatcher_factory_; | 331 base::WeakPtrFactory<WebIntentPickerController> dispatcher_factory_; |
320 | 332 |
321 // Bucket identifier for UMA reporting. Saved off in a field | 333 // Bucket identifier for UMA reporting. Saved off in a field |
322 // to avoid repeated calculation of the bucket across | 334 // to avoid repeated calculation of the bucket across |
323 // multiple UMA calls. Should be recalculated each time | 335 // multiple UMA calls. Should be recalculated each time |
324 // |intents_dispatcher_| is set. | 336 // |intents_dispatcher_| is set. |
325 web_intents::UMABucket uma_bucket_; | 337 web_intents::UMABucket uma_bucket_; |
326 | 338 |
| 339 // The ID of a pending extension download. |
| 340 content::DownloadId download_id_; |
| 341 |
327 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController); | 342 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerController); |
328 }; | 343 }; |
329 | 344 |
330 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ | 345 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_CONTROLLER_H_ |
OLD | NEW |