Chromium Code Reviews| 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_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ | 6 #define CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/string16.h" | 11 #include "base/string16.h" |
| 12 #include "chrome/browser/extensions/extension_install_prompt.h" | |
| 12 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 13 #include "ui/gfx/image/image.h" | 14 #include "ui/gfx/image/image.h" |
| 14 #include "webkit/glue/web_intent_service_data.h" | 15 #include "webkit/glue/web_intent_service_data.h" |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 class DownloadItem; | 18 class DownloadItem; |
| 18 } | 19 } |
| 19 | 20 |
| 20 class WebIntentPickerModelObserver; | 21 class WebIntentPickerModelObserver; |
| 21 | 22 |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 173 } | 174 } |
| 174 | 175 |
| 175 // Sets the status of extension install process. | 176 // Sets the status of extension install process. |
| 176 void SetPendingExtensionInstallStatusString(const string16& status); | 177 void SetPendingExtensionInstallStatusString(const string16& status); |
| 177 | 178 |
| 178 // Gets the status of extension install process. | 179 // Gets the status of extension install process. |
| 179 const string16& pending_extension_install_status_string() const { | 180 const string16& pending_extension_install_status_string() const { |
| 180 return pending_extension_install_status_string_; | 181 return pending_extension_install_status_string_; |
| 181 } | 182 } |
| 182 | 183 |
| 184 // Sets the extension install delegate. | |
| 185 void SetPendingExtensionInstallDelegate( | |
|
Greg Billock
2012/10/03 17:20:35
Should these go on the picker dialog itself? It do
sail
2012/10/03 20:24:29
Caching these values is really convenient for the
Greg Billock
2012/10/03 21:15:38
OK. Like I was saying tearing out the intent data
| |
| 186 ExtensionInstallPrompt::Delegate* delegate); | |
| 187 | |
| 188 // Gets the extension install delegate. | |
| 189 ExtensionInstallPrompt::Delegate* pending_extension_install_delegate() const { | |
| 190 return pending_extension_install_delegate_; | |
| 191 } | |
| 192 | |
| 193 // Sets the extension install prompt. | |
| 194 void SetPendingExtensionInstallPrompt( | |
| 195 const ExtensionInstallPrompt::Prompt& prompt); | |
| 196 | |
| 197 // Gets the extension install prompt. | |
| 198 const ExtensionInstallPrompt::Prompt* pending_extension_install_prompt() | |
| 199 const { | |
| 200 return pending_extension_install_prompt_.get(); | |
| 201 } | |
| 202 | |
| 183 // Removes any pending extension install state. | 203 // Removes any pending extension install state. |
| 184 void ClearPendingExtensionInstall(); | 204 void ClearPendingExtensionInstall(); |
| 185 | 205 |
| 186 private: | 206 private: |
| 187 // Delete all elements in |installed_services_| and |suggested_extensions_|. | 207 // Delete all elements in |installed_services_| and |suggested_extensions_|. |
| 188 // Note that this method does not reset the observer. | 208 // Note that this method does not reset the observer. |
| 189 void DestroyAll(); | 209 void DestroyAll(); |
| 190 | 210 |
| 191 // A vector of all installed services in the picker. Each installed service | 211 // A vector of all installed services in the picker. Each installed service |
| 192 // is owned by this model. | 212 // is owned by this model. |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 215 // Indicates that there are still open requests to CWS. | 235 // Indicates that there are still open requests to CWS. |
| 216 bool waiting_for_suggestions_; | 236 bool waiting_for_suggestions_; |
| 217 | 237 |
| 218 // The hash context for the default service, if there is one. | 238 // The hash context for the default service, if there is one. |
| 219 int64 default_service_hash_; | 239 int64 default_service_hash_; |
| 220 | 240 |
| 221 // Information about the pending extension install. | 241 // Information about the pending extension install. |
| 222 std::string pending_extension_install_id_; | 242 std::string pending_extension_install_id_; |
| 223 int pending_extension_install_download_progress_; | 243 int pending_extension_install_download_progress_; |
| 224 string16 pending_extension_install_status_string_; | 244 string16 pending_extension_install_status_string_; |
| 245 ExtensionInstallPrompt::Delegate* pending_extension_install_delegate_; | |
| 246 scoped_ptr<ExtensionInstallPrompt::Prompt> pending_extension_install_prompt_; | |
| 225 | 247 |
| 226 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); | 248 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); |
| 227 }; | 249 }; |
| 228 | 250 |
| 229 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ | 251 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ |
| OLD | NEW |