| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 } | 169 } |
| 169 | 170 |
| 170 // Sets the status of extension install process. | 171 // Sets the status of extension install process. |
| 171 void SetPendingExtensionInstallStatusString(const string16& status); | 172 void SetPendingExtensionInstallStatusString(const string16& status); |
| 172 | 173 |
| 173 // Gets the status of extension install process. | 174 // Gets the status of extension install process. |
| 174 const string16& pending_extension_install_status_string() const { | 175 const string16& pending_extension_install_status_string() const { |
| 175 return pending_extension_install_status_string_; | 176 return pending_extension_install_status_string_; |
| 176 } | 177 } |
| 177 | 178 |
| 179 // Sets the extension install delegate. |
| 180 void SetPendingExtensionInstallDelegate( |
| 181 ExtensionInstallPrompt::Delegate* delegate); |
| 182 |
| 183 // Gets the extension install delegate. |
| 184 ExtensionInstallPrompt::Delegate* pending_extension_install_delegate() const { |
| 185 return pending_extension_install_delegate_; |
| 186 } |
| 187 |
| 188 // Sets the extension install prompt. |
| 189 void SetPendingExtensionInstallPrompt( |
| 190 const ExtensionInstallPrompt::Prompt& prompt); |
| 191 |
| 192 // Gets the extension install prompt. |
| 193 const ExtensionInstallPrompt::Prompt* pending_extension_install_prompt() |
| 194 const { |
| 195 return pending_extension_install_prompt_.get(); |
| 196 } |
| 197 |
| 178 // Removes any pending extension install state. | 198 // Removes any pending extension install state. |
| 179 void ClearPendingExtensionInstall(); | 199 void ClearPendingExtensionInstall(); |
| 180 | 200 |
| 181 private: | 201 private: |
| 182 // Delete all elements in |installed_services_| and |suggested_extensions_|. | 202 // Delete all elements in |installed_services_| and |suggested_extensions_|. |
| 183 // Note that this method does not reset the observer. | 203 // Note that this method does not reset the observer. |
| 184 void DestroyAll(); | 204 void DestroyAll(); |
| 185 | 205 |
| 186 // A vector of all installed services in the picker. Each installed service | 206 // A vector of all installed services in the picker. Each installed service |
| 187 // is owned by this model. | 207 // is owned by this model. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 207 // finds a default service matching the intent being dispatched. | 227 // finds a default service matching the intent being dispatched. |
| 208 GURL default_service_url_; | 228 GURL default_service_url_; |
| 209 | 229 |
| 210 // Indicates that there are still open requests to CWS. | 230 // Indicates that there are still open requests to CWS. |
| 211 bool waiting_for_suggestions_; | 231 bool waiting_for_suggestions_; |
| 212 | 232 |
| 213 // Information about the pending extension install. | 233 // Information about the pending extension install. |
| 214 std::string pending_extension_install_id_; | 234 std::string pending_extension_install_id_; |
| 215 int pending_extension_install_download_progress_; | 235 int pending_extension_install_download_progress_; |
| 216 string16 pending_extension_install_status_string_; | 236 string16 pending_extension_install_status_string_; |
| 237 ExtensionInstallPrompt::Delegate* pending_extension_install_delegate_; |
| 238 scoped_ptr<ExtensionInstallPrompt::Prompt> pending_extension_install_prompt_; |
| 217 | 239 |
| 218 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); | 240 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); |
| 219 }; | 241 }; |
| 220 | 242 |
| 221 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ | 243 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ |
| OLD | NEW |