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_install_helper.h" |
16 #include "chrome/browser/extensions/webstore_installer.h" | 16 #include "chrome/browser/extensions/webstore_installer.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 namespace extensions { |
| 25 class Extension; |
| 26 } |
| 27 |
24 // Manages inline installs requested by a page (downloads and parses metadata | 28 // 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 | 29 // from the webstore, shows the install UI, starts the download once the user |
26 // confirms). Clients must implement the WebstoreInlineInstaller::Delegate | 30 // confirms). Clients must implement the WebstoreInlineInstaller::Delegate |
27 // interface to be notified when the inline install completes (successfully or | 31 // interface to be notified when the inline install completes (successfully or |
28 // not). The client will not be notified if the WebContents that this install | 32 // not). The client will not be notified if the WebContents that this install |
29 // request is attached to goes away. | 33 // request is attached to goes away. |
30 class WebstoreInlineInstaller | 34 class WebstoreInlineInstaller |
31 : public base::RefCountedThreadSafe<WebstoreInlineInstaller>, | 35 : public base::RefCountedThreadSafe<WebstoreInlineInstaller>, |
32 public ExtensionInstallUI::Delegate, | 36 public ExtensionInstallUI::Delegate, |
33 public content::WebContentsObserver, | 37 public content::WebContentsObserver, |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 scoped_ptr<content::URLFetcher> webstore_data_url_fetcher_; | 124 scoped_ptr<content::URLFetcher> webstore_data_url_fetcher_; |
121 | 125 |
122 // Extracted from the webstore JSON data response. | 126 // Extracted from the webstore JSON data response. |
123 std::string localized_name_; | 127 std::string localized_name_; |
124 std::string localized_description_; | 128 std::string localized_description_; |
125 std::string localized_user_count_; | 129 std::string localized_user_count_; |
126 double average_rating_; | 130 double average_rating_; |
127 int rating_count_; | 131 int rating_count_; |
128 scoped_ptr<DictionaryValue> webstore_data_; | 132 scoped_ptr<DictionaryValue> webstore_data_; |
129 scoped_ptr<DictionaryValue> manifest_; | 133 scoped_ptr<DictionaryValue> manifest_; |
130 scoped_refptr<Extension> dummy_extension_; | 134 scoped_refptr<extensions::Extension> dummy_extension_; |
131 SkBitmap icon_; | 135 SkBitmap icon_; |
132 | 136 |
133 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); | 137 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); |
134 }; | 138 }; |
135 | 139 |
136 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ | 140 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ |
OLD | NEW |