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

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

Issue 384823002: Introduce a stable set of errors for inline install (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
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"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/extensions/extension_install_prompt.h" 13 #include "chrome/browser/extensions/extension_install_prompt.h"
14 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h" 14 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h"
15 #include "chrome/browser/extensions/webstore_install_helper.h" 15 #include "chrome/browser/extensions/webstore_install_helper.h"
16 #include "chrome/browser/extensions/webstore_install_result.h"
17 #include "chrome/browser/extensions/webstore_installer.h" 16 #include "chrome/browser/extensions/webstore_installer.h"
17 #include "chrome/common/extensions/webstore_install_result.h"
18 #include "net/url_request/url_fetcher_delegate.h" 18 #include "net/url_request/url_fetcher_delegate.h"
19 #include "third_party/skia/include/core/SkBitmap.h" 19 #include "third_party/skia/include/core/SkBitmap.h"
20 20
21 class GURL; 21 class GURL;
22 22
23 namespace base { 23 namespace base {
24 class DictionaryValue; 24 class DictionaryValue;
25 } 25 }
26 26
27 namespace net { 27 namespace net {
(...skipping 16 matching lines...) Expand all
44 class WebstoreStandaloneInstaller 44 class WebstoreStandaloneInstaller
45 : public base::RefCountedThreadSafe<WebstoreStandaloneInstaller>, 45 : public base::RefCountedThreadSafe<WebstoreStandaloneInstaller>,
46 public ExtensionInstallPrompt::Delegate, 46 public ExtensionInstallPrompt::Delegate,
47 public WebstoreDataFetcherDelegate, 47 public WebstoreDataFetcherDelegate,
48 public WebstoreInstaller::Delegate, 48 public WebstoreInstaller::Delegate,
49 public WebstoreInstallHelper::Delegate { 49 public WebstoreInstallHelper::Delegate {
50 public: 50 public:
51 // A callback for when the install process completes, successfully or not. If 51 // A callback for when the install process completes, successfully or not. If
52 // there was a failure, |success| will be false and |error| may contain a 52 // there was a failure, |success| will be false and |error| may contain a
53 // developer-readable error message about why it failed. 53 // developer-readable error message about why it failed.
54 typedef base::Callback<void(bool success, const std::string& error)> Callback; 54 typedef base::Callback<void(bool success,
55 const std::string& error,
56 webstore_install::Result result)> Callback;
55 57
56 WebstoreStandaloneInstaller(const std::string& webstore_item_id, 58 WebstoreStandaloneInstaller(const std::string& webstore_item_id,
57 Profile* profile, 59 Profile* profile,
58 const Callback& callback); 60 const Callback& callback);
59 void BeginInstall(); 61 void BeginInstall();
60 62
61 protected: 63 protected:
62 virtual ~WebstoreStandaloneInstaller(); 64 virtual ~WebstoreStandaloneInstaller();
63 65
64 // Called when the install should be aborted. The callback is cleared. 66 // Called when the install should be aborted. The callback is cleared.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 // Created by ShowInstallUI() when a prompt is shown (if 233 // Created by ShowInstallUI() when a prompt is shown (if
232 // the implementor returns a non-NULL in CreateInstallPrompt()). 234 // the implementor returns a non-NULL in CreateInstallPrompt()).
233 scoped_refptr<Extension> localized_extension_for_display_; 235 scoped_refptr<Extension> localized_extension_for_display_;
234 236
235 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStandaloneInstaller); 237 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStandaloneInstaller);
236 }; 238 };
237 239
238 } // namespace extensions 240 } // namespace extensions
239 241
240 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_ 242 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698