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

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: Replace printf with vlog(1) in unrelated code so it passes presubmit 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/active_install_data.h" 13 #include "chrome/browser/extensions/active_install_data.h"
14 #include "chrome/browser/extensions/extension_install_prompt.h" 14 #include "chrome/browser/extensions/extension_install_prompt.h"
15 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h" 15 #include "chrome/browser/extensions/webstore_data_fetcher_delegate.h"
16 #include "chrome/browser/extensions/webstore_install_helper.h" 16 #include "chrome/browser/extensions/webstore_install_helper.h"
17 #include "chrome/browser/extensions/webstore_install_result.h"
18 #include "chrome/browser/extensions/webstore_installer.h" 17 #include "chrome/browser/extensions/webstore_installer.h"
18 #include "chrome/common/extensions/webstore_install_result.h"
19 #include "net/url_request/url_fetcher_delegate.h" 19 #include "net/url_request/url_fetcher_delegate.h"
20 #include "third_party/skia/include/core/SkBitmap.h" 20 #include "third_party/skia/include/core/SkBitmap.h"
21 21
22 class GURL; 22 class GURL;
23 23
24 namespace base { 24 namespace base {
25 class DictionaryValue; 25 class DictionaryValue;
26 } 26 }
27 27
28 namespace net { 28 namespace net {
(...skipping 16 matching lines...) Expand all
45 class WebstoreStandaloneInstaller 45 class WebstoreStandaloneInstaller
46 : public base::RefCountedThreadSafe<WebstoreStandaloneInstaller>, 46 : public base::RefCountedThreadSafe<WebstoreStandaloneInstaller>,
47 public ExtensionInstallPrompt::Delegate, 47 public ExtensionInstallPrompt::Delegate,
48 public WebstoreDataFetcherDelegate, 48 public WebstoreDataFetcherDelegate,
49 public WebstoreInstaller::Delegate, 49 public WebstoreInstaller::Delegate,
50 public WebstoreInstallHelper::Delegate { 50 public WebstoreInstallHelper::Delegate {
51 public: 51 public:
52 // A callback for when the install process completes, successfully or not. If 52 // A callback for when the install process completes, successfully or not. If
53 // there was a failure, |success| will be false and |error| may contain a 53 // there was a failure, |success| will be false and |error| may contain a
54 // developer-readable error message about why it failed. 54 // developer-readable error message about why it failed.
55 typedef base::Callback<void(bool success, const std::string& error)> Callback; 55 typedef base::Callback<void(bool success,
56 const std::string& error,
57 webstore_install::Result result)> Callback;
56 58
57 WebstoreStandaloneInstaller(const std::string& webstore_item_id, 59 WebstoreStandaloneInstaller(const std::string& webstore_item_id,
58 Profile* profile, 60 Profile* profile,
59 const Callback& callback); 61 const Callback& callback);
60 void BeginInstall(); 62 void BeginInstall();
61 63
62 protected: 64 protected:
63 virtual ~WebstoreStandaloneInstaller(); 65 virtual ~WebstoreStandaloneInstaller();
64 66
65 // Called when the install should be aborted. The callback is cleared. 67 // Called when the install should be aborted. The callback is cleared.
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 // Created by ShowInstallUI() when a prompt is shown (if 246 // Created by ShowInstallUI() when a prompt is shown (if
245 // the implementor returns a non-NULL in CreateInstallPrompt()). 247 // the implementor returns a non-NULL in CreateInstallPrompt()).
246 scoped_refptr<Extension> localized_extension_for_display_; 248 scoped_refptr<Extension> localized_extension_for_display_;
247 249
248 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStandaloneInstaller); 250 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreStandaloneInstaller);
249 }; 251 };
250 252
251 } // namespace extensions 253 } // namespace extensions
252 254
253 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_ 255 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_STANDALONE_INSTALLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698