Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: chrome/browser/extensions/webstore_standalone_installer.h

Issue 557953005: Allow the user to "repair" a corrupted extension. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest Master Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 webstore_install::Result result)> Callback; 57 webstore_install::Result result)> Callback;
58 58
59 WebstoreStandaloneInstaller(const std::string& webstore_item_id, 59 WebstoreStandaloneInstaller(const std::string& webstore_item_id,
60 Profile* profile, 60 Profile* profile,
61 const Callback& callback); 61 const Callback& callback);
62 void BeginInstall(); 62 void BeginInstall();
63 63
64 protected: 64 protected:
65 virtual ~WebstoreStandaloneInstaller(); 65 virtual ~WebstoreStandaloneInstaller();
66 66
67 // Runs the callback; primarily used for running a callback before it is
68 // cleared in AbortInstall().
69 void RunCallback(
70 bool success, const std::string& error, webstore_install::Result result);
71
67 // Called when the install should be aborted. The callback is cleared. 72 // Called when the install should be aborted. The callback is cleared.
68 void AbortInstall(); 73 void AbortInstall();
69 74
70 // Checks InstallTracker and returns true if the same extension is not 75 // Checks InstallTracker and returns true if the same extension is not
71 // currently being installed. Registers this install with the InstallTracker. 76 // currently being installed. Registers this install with the InstallTracker.
72 bool EnsureUniqueInstall(webstore_install::Result* reason, 77 bool EnsureUniqueInstall(webstore_install::Result* reason,
73 std::string* error); 78 std::string* error);
74 79
75 // Called when the install is complete. 80 // Called when the install is complete.
76 virtual void CompleteInstall(webstore_install::Result result, 81 virtual void CompleteInstall(webstore_install::Result result,
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // ProceedWithInstallPrompt(). 144 // ProceedWithInstallPrompt().
140 virtual void OnManifestParsed(); 145 virtual void OnManifestParsed();
141 146
142 // 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
143 // that is a transient child of the host window for GetWebContents(). 148 // that is a transient child of the host window for GetWebContents().
144 virtual scoped_ptr<ExtensionInstallPrompt> CreateInstallUI(); 149 virtual scoped_ptr<ExtensionInstallPrompt> CreateInstallUI();
145 150
146 // Create an approval to pass installation parameters to the CrxInstaller. 151 // Create an approval to pass installation parameters to the CrxInstaller.
147 virtual scoped_ptr<WebstoreInstaller::Approval> CreateApproval() const; 152 virtual scoped_ptr<WebstoreInstaller::Approval> CreateApproval() const;
148 153
154 // ExtensionInstallPrompt::Delegate interface implementation.
155 virtual void InstallUIProceed() OVERRIDE;
156 virtual void InstallUIAbort(bool user_initiated) OVERRIDE;
157
149 // Accessors to be used by subclasses. 158 // Accessors to be used by subclasses.
150 bool show_user_count() const { return show_user_count_; } 159 bool show_user_count() const { return show_user_count_; }
151 const std::string& localized_user_count() const { 160 const std::string& localized_user_count() const {
152 return localized_user_count_; 161 return localized_user_count_;
153 } 162 }
154 double average_rating() const { return average_rating_; } 163 double average_rating() const { return average_rating_; }
155 int rating_count() const { return rating_count_; } 164 int rating_count() const { return rating_count_; }
156 void set_install_source(WebstoreInstaller::InstallSource source) { 165 void set_install_source(WebstoreInstaller::InstallSource source) {
157 install_source_ = source; 166 install_source_ = source;
158 } 167 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 // WebstoreInstallHelper::Delegate interface implementation. 204 // WebstoreInstallHelper::Delegate interface implementation.
196 virtual void OnWebstoreParseSuccess( 205 virtual void OnWebstoreParseSuccess(
197 const std::string& id, 206 const std::string& id,
198 const SkBitmap& icon, 207 const SkBitmap& icon,
199 base::DictionaryValue* parsed_manifest) OVERRIDE; 208 base::DictionaryValue* parsed_manifest) OVERRIDE;
200 virtual void OnWebstoreParseFailure( 209 virtual void OnWebstoreParseFailure(
201 const std::string& id, 210 const std::string& id,
202 InstallHelperResultCode result_code, 211 InstallHelperResultCode result_code,
203 const std::string& error_message) OVERRIDE; 212 const std::string& error_message) OVERRIDE;
204 213
205 // ExtensionInstallPrompt::Delegate interface implementation.
206 virtual void InstallUIProceed() OVERRIDE;
207 virtual void InstallUIAbort(bool user_initiated) OVERRIDE;
208
209 // WebstoreInstaller::Delegate interface implementation. 214 // WebstoreInstaller::Delegate interface implementation.
210 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE; 215 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE;
211 virtual void OnExtensionInstallFailure( 216 virtual void OnExtensionInstallFailure(
212 const std::string& id, 217 const std::string& id,
213 const std::string& error, 218 const std::string& error,
214 WebstoreInstaller::FailureReason reason) OVERRIDE; 219 WebstoreInstaller::FailureReason reason) OVERRIDE;
215 220
216 void ShowInstallUI(); 221 void ShowInstallUI();
217 void OnWebStoreDataFetcherDone(); 222 void OnWebStoreDataFetcherDone();
218 223
(...skipping 27 matching lines...) Expand all
246 // Created by ShowInstallUI() when a prompt is shown (if 251 // Created by ShowInstallUI() when a prompt is shown (if
247 // the implementor returns a non-NULL in CreateInstallPrompt()). 252 // the implementor returns a non-NULL in CreateInstallPrompt()).
248 scoped_refptr<Extension> localized_extension_for_display_; 253 scoped_refptr<Extension> localized_extension_for_display_;
249 254
250 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStandaloneInstaller); 255 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStandaloneInstaller);
251 }; 256 };
252 257
253 } // namespace extensions 258 } // namespace extensions
254 259
255 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_ 260 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698