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_INLINE_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
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 "base/values.h" | 13 #include "base/values.h" |
14 #include "chrome/browser/extensions/extension_install_ui.h" | 14 #include "chrome/browser/extensions/extension_install_ui.h" |
| 15 #include "chrome/browser/extensions/webstore_install_helper.h" |
15 #include "chrome/browser/extensions/webstore_installer.h" | 16 #include "chrome/browser/extensions/webstore_installer.h" |
16 #include "chrome/browser/extensions/webstore_install_helper.h" | |
17 #include "content/public/browser/web_contents_observer.h" | 17 #include "content/public/browser/web_contents_observer.h" |
18 #include "content/public/common/url_fetcher_delegate.h" | 18 #include "content/public/common/url_fetcher_delegate.h" |
19 #include "googleurl/src/gurl.h" | 19 #include "googleurl/src/gurl.h" |
20 #include "third_party/skia/include/core/SkBitmap.h" | 20 #include "third_party/skia/include/core/SkBitmap.h" |
21 | 21 |
22 class SafeWebstoreResponseParser; | 22 class SafeWebstoreResponseParser; |
23 | 23 |
24 // Manages inline installs requested by a page (downloads and parses metadata | 24 // Manages inline installs requested by a page (downloads and parses metadata |
25 // from the webstore, shows the install UI, starts the download once the user | 25 // from the webstore, shows the install UI, starts the download once the user |
26 // confirms). Clients must implement the WebstoreInlineInstaller::Delegate | 26 // confirms). Clients must implement the WebstoreInlineInstaller::Delegate |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // 2. OnURLFetchComplete: starts the parsing of data from the webstore | 66 // 2. OnURLFetchComplete: starts the parsing of data from the webstore |
67 // 3. OnWebstoreResponseParseSuccess: starts the parsing of the manifest and | 67 // 3. OnWebstoreResponseParseSuccess: starts the parsing of the manifest and |
68 // fetching of icon data. | 68 // fetching of icon data. |
69 // 4. OnWebstoreParseSuccess: shows the install UI | 69 // 4. OnWebstoreParseSuccess: shows the install UI |
70 // 5. InstallUIProceed: initiates the .crx download/install | 70 // 5. InstallUIProceed: initiates the .crx download/install |
71 // | 71 // |
72 // All flows (whether successful or not) end up in CompleteInstall, which | 72 // All flows (whether successful or not) end up in CompleteInstall, which |
73 // informs our delegate of success/failure. | 73 // informs our delegate of success/failure. |
74 | 74 |
75 // content::URLFetcherDelegate interface implementation. | 75 // content::URLFetcherDelegate interface implementation. |
76 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; | 76 virtual void OnURLFetchComplete(const net::URLFetcher* source) OVERRIDE; |
77 | 77 |
78 // Client callbacks for SafeWebstoreResponseParser when parsing is complete. | 78 // Client callbacks for SafeWebstoreResponseParser when parsing is complete. |
79 void OnWebstoreResponseParseSuccess(DictionaryValue* webstore_data); | 79 void OnWebstoreResponseParseSuccess(DictionaryValue* webstore_data); |
80 void OnWebstoreResponseParseFailure(const std::string& error); | 80 void OnWebstoreResponseParseFailure(const std::string& error); |
81 | 81 |
82 // WebstoreInstallHelper::Delegate interface implementation. | 82 // WebstoreInstallHelper::Delegate interface implementation. |
83 virtual void OnWebstoreParseSuccess( | 83 virtual void OnWebstoreParseSuccess( |
84 const std::string& id, | 84 const std::string& id, |
85 const SkBitmap& icon, | 85 const SkBitmap& icon, |
86 base::DictionaryValue* parsed_manifest) OVERRIDE; | 86 base::DictionaryValue* parsed_manifest) OVERRIDE; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 int rating_count_; | 127 int rating_count_; |
128 scoped_ptr<DictionaryValue> webstore_data_; | 128 scoped_ptr<DictionaryValue> webstore_data_; |
129 scoped_ptr<DictionaryValue> manifest_; | 129 scoped_ptr<DictionaryValue> manifest_; |
130 scoped_refptr<Extension> dummy_extension_; | 130 scoped_refptr<Extension> dummy_extension_; |
131 SkBitmap icon_; | 131 SkBitmap icon_; |
132 | 132 |
133 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); | 133 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); |
134 }; | 134 }; |
135 | 135 |
136 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ | 136 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ |
OLD | NEW |