| 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_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 virtual void OnManifestParsed(); | 145 virtual void OnManifestParsed(); |
| 146 | 146 |
| 147 // Returns an install UI to be shown. By default, this returns an install UI | 147 // Returns an install UI to be shown. By default, this returns an install UI |
| 148 // that is a transient child of the host window for GetWebContents(). | 148 // that is a transient child of the host window for GetWebContents(). |
| 149 virtual scoped_ptr<ExtensionInstallPrompt> CreateInstallUI(); | 149 virtual scoped_ptr<ExtensionInstallPrompt> CreateInstallUI(); |
| 150 | 150 |
| 151 // Create an approval to pass installation parameters to the CrxInstaller. | 151 // Create an approval to pass installation parameters to the CrxInstaller. |
| 152 virtual scoped_ptr<WebstoreInstaller::Approval> CreateApproval() const; | 152 virtual scoped_ptr<WebstoreInstaller::Approval> CreateApproval() const; |
| 153 | 153 |
| 154 // ExtensionInstallPrompt::Delegate interface implementation. | 154 // ExtensionInstallPrompt::Delegate interface implementation. |
| 155 virtual void InstallUIProceed() OVERRIDE; | 155 virtual void InstallUIProceed() override; |
| 156 virtual void InstallUIAbort(bool user_initiated) OVERRIDE; | 156 virtual void InstallUIAbort(bool user_initiated) override; |
| 157 | 157 |
| 158 // Accessors to be used by subclasses. | 158 // Accessors to be used by subclasses. |
| 159 bool show_user_count() const { return show_user_count_; } | 159 bool show_user_count() const { return show_user_count_; } |
| 160 const std::string& localized_user_count() const { | 160 const std::string& localized_user_count() const { |
| 161 return localized_user_count_; | 161 return localized_user_count_; |
| 162 } | 162 } |
| 163 double average_rating() const { return average_rating_; } | 163 double average_rating() const { return average_rating_; } |
| 164 int rating_count() const { return rating_count_; } | 164 int rating_count() const { return rating_count_; } |
| 165 void set_install_source(WebstoreInstaller::InstallSource source) { | 165 void set_install_source(WebstoreInstaller::InstallSource source) { |
| 166 install_source_ = source; | 166 install_source_ = source; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 186 // 2. OnURLFetchComplete: starts the parsing of data from the webstore | 186 // 2. OnURLFetchComplete: starts the parsing of data from the webstore |
| 187 // 3. OnWebstoreResponseParseSuccess: starts the parsing of the manifest and | 187 // 3. OnWebstoreResponseParseSuccess: starts the parsing of the manifest and |
| 188 // fetching of icon data. | 188 // fetching of icon data. |
| 189 // 4. OnWebstoreParseSuccess: shows the install UI | 189 // 4. OnWebstoreParseSuccess: shows the install UI |
| 190 // 5. InstallUIProceed: initiates the .crx download/install | 190 // 5. InstallUIProceed: initiates the .crx download/install |
| 191 // | 191 // |
| 192 // All flows (whether successful or not) end up in CompleteInstall, which | 192 // All flows (whether successful or not) end up in CompleteInstall, which |
| 193 // informs our delegate of success/failure. | 193 // informs our delegate of success/failure. |
| 194 | 194 |
| 195 // WebstoreDataFetcherDelegate interface implementation. | 195 // WebstoreDataFetcherDelegate interface implementation. |
| 196 virtual void OnWebstoreRequestFailure() OVERRIDE; | 196 virtual void OnWebstoreRequestFailure() override; |
| 197 | 197 |
| 198 virtual void OnWebstoreResponseParseSuccess( | 198 virtual void OnWebstoreResponseParseSuccess( |
| 199 scoped_ptr<base::DictionaryValue> webstore_data) OVERRIDE; | 199 scoped_ptr<base::DictionaryValue> webstore_data) override; |
| 200 | 200 |
| 201 virtual void OnWebstoreResponseParseFailure( | 201 virtual void OnWebstoreResponseParseFailure( |
| 202 const std::string& error) OVERRIDE; | 202 const std::string& error) override; |
| 203 | 203 |
| 204 // WebstoreInstallHelper::Delegate interface implementation. | 204 // WebstoreInstallHelper::Delegate interface implementation. |
| 205 virtual void OnWebstoreParseSuccess( | 205 virtual void OnWebstoreParseSuccess( |
| 206 const std::string& id, | 206 const std::string& id, |
| 207 const SkBitmap& icon, | 207 const SkBitmap& icon, |
| 208 base::DictionaryValue* parsed_manifest) OVERRIDE; | 208 base::DictionaryValue* parsed_manifest) override; |
| 209 virtual void OnWebstoreParseFailure( | 209 virtual void OnWebstoreParseFailure( |
| 210 const std::string& id, | 210 const std::string& id, |
| 211 InstallHelperResultCode result_code, | 211 InstallHelperResultCode result_code, |
| 212 const std::string& error_message) OVERRIDE; | 212 const std::string& error_message) override; |
| 213 | 213 |
| 214 // WebstoreInstaller::Delegate interface implementation. | 214 // WebstoreInstaller::Delegate interface implementation. |
| 215 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; | 215 virtual void OnExtensionInstallSuccess(const std::string& id) override; |
| 216 virtual void OnExtensionInstallFailure( | 216 virtual void OnExtensionInstallFailure( |
| 217 const std::string& id, | 217 const std::string& id, |
| 218 const std::string& error, | 218 const std::string& error, |
| 219 WebstoreInstaller::FailureReason reason) OVERRIDE; | 219 WebstoreInstaller::FailureReason reason) override; |
| 220 | 220 |
| 221 void ShowInstallUI(); | 221 void ShowInstallUI(); |
| 222 void OnWebStoreDataFetcherDone(); | 222 void OnWebStoreDataFetcherDone(); |
| 223 | 223 |
| 224 // Input configuration. | 224 // Input configuration. |
| 225 std::string id_; | 225 std::string id_; |
| 226 Callback callback_; | 226 Callback callback_; |
| 227 Profile* profile_; | 227 Profile* profile_; |
| 228 WebstoreInstaller::InstallSource install_source_; | 228 WebstoreInstaller::InstallSource install_source_; |
| 229 | 229 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 251 // Created by ShowInstallUI() when a prompt is shown (if | 251 // Created by ShowInstallUI() when a prompt is shown (if |
| 252 // the implementor returns a non-NULL in CreateInstallPrompt()). | 252 // the implementor returns a non-NULL in CreateInstallPrompt()). |
| 253 scoped_refptr<Extension> localized_extension_for_display_; | 253 scoped_refptr<Extension> localized_extension_for_display_; |
| 254 | 254 |
| 255 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStandaloneInstaller); | 255 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStandaloneInstaller); |
| 256 }; | 256 }; |
| 257 | 257 |
| 258 } // namespace extensions | 258 } // namespace extensions |
| 259 | 259 |
| 260 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_ | 260 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_ |
| OLD | NEW |