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