| 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" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 // Returns true if there is still a pending request for suggestions from CWS. | 136 // Returns true if there is still a pending request for suggestions from CWS. |
| 137 bool IsWaitingForSuggestions() const; | 137 bool IsWaitingForSuggestions() const; |
| 138 | 138 |
| 139 // Set the "waiting for suggestions" status to |waiting| | 139 // Set the "waiting for suggestions" status to |waiting| |
| 140 void SetWaitingForSuggestions(bool waiting); | 140 void SetWaitingForSuggestions(bool waiting); |
| 141 | 141 |
| 142 // Returns the url of the intent service that is being displayed inline, or | 142 // Returns the url of the intent service that is being displayed inline, or |
| 143 // GURL::EmptyGURL() if none. | 143 // GURL::EmptyGURL() if none. |
| 144 const GURL& inline_disposition_url() const { return inline_disposition_url_; } | 144 const GURL& inline_disposition_url() const { return inline_disposition_url_; } |
| 145 | 145 |
| 146 // Sets the ID of the extension currently being installed. |
| 147 void SetPendingInstallExtensionId(const std::string& id); |
| 148 |
| 149 // Gets the ID of the extension currently being installed. |
| 150 const std::string& pending_install_extension_id() const { |
| 151 return pending_install_extension_id_; |
| 152 } |
| 153 |
| 154 // Sets the download progress of the extension currently being downloaded. |
| 155 void SetPendingInstallDownloadPercent(int percent); |
| 156 |
| 157 // Gets the download progress of the extension currently being downloaded. |
| 158 int pending_install_download_percent() const { |
| 159 return pending_install_download_percent_; |
| 160 } |
| 161 |
| 162 // Sets the status of extension install process. |
| 163 void SetPendingInstallStatusString(const string16& status); |
| 164 |
| 165 // Gets the status of extension install process. |
| 166 const string16& pending_install_status_string() const { |
| 167 return pending_install_status_string_; |
| 168 } |
| 169 |
| 170 // Removes any pending extension install state. |
| 171 void ClearPendingInstall(); |
| 172 |
| 146 private: | 173 private: |
| 147 // Delete all elements in |installed_services_| and |suggested_extensions_|. | 174 // Delete all elements in |installed_services_| and |suggested_extensions_|. |
| 148 // Note that this method does not reset the observer. | 175 // Note that this method does not reset the observer. |
| 149 void DestroyAll(); | 176 void DestroyAll(); |
| 150 | 177 |
| 151 // A vector of all installed services in the picker. Each installed service | 178 // A vector of all installed services in the picker. Each installed service |
| 152 // is owned by this model. | 179 // is owned by this model. |
| 153 std::vector<InstalledService*> installed_services_; | 180 std::vector<InstalledService*> installed_services_; |
| 154 | 181 |
| 155 // A vector of all suggested extensions in the picker. | 182 // A vector of all suggested extensions in the picker. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 171 // The non-empty url of the default service if the WebIntentsRegistry | 198 // The non-empty url of the default service if the WebIntentsRegistry |
| 172 // finds a default service matching the intent being dispatched. | 199 // finds a default service matching the intent being dispatched. |
| 173 GURL default_service_url_; | 200 GURL default_service_url_; |
| 174 | 201 |
| 175 // Indicates that there are still open requests to CWS. | 202 // Indicates that there are still open requests to CWS. |
| 176 bool waiting_for_suggestions_; | 203 bool waiting_for_suggestions_; |
| 177 | 204 |
| 178 // The hash context for the default service, if there is one. | 205 // The hash context for the default service, if there is one. |
| 179 int64 default_service_hash_; | 206 int64 default_service_hash_; |
| 180 | 207 |
| 208 // Information about the pending extension install. |
| 209 std::string pending_install_extension_id_; |
| 210 int pending_install_download_percent_; |
| 211 string16 pending_install_status_string_; |
| 212 |
| 181 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); | 213 DISALLOW_COPY_AND_ASSIGN(WebIntentPickerModel); |
| 182 }; | 214 }; |
| 183 | 215 |
| 184 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ | 216 #endif // CHROME_BROWSER_UI_INTENTS_WEB_INTENT_PICKER_MODEL_H_ |
| OLD | NEW |