OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 // 2. OnURLFetchComplete: starts the parsing of data from the webstore | 63 // 2. OnURLFetchComplete: starts the parsing of data from the webstore |
64 // 3. OnWebstoreResponseParseSuccess: starts the parsing of the manifest and | 64 // 3. OnWebstoreResponseParseSuccess: starts the parsing of the manifest and |
65 // fetching of icon data. | 65 // fetching of icon data. |
66 // 4. OnWebstoreParseSuccess: shows the install UI | 66 // 4. OnWebstoreParseSuccess: shows the install UI |
67 // 5. InstallUIProceed: initiates the .crx download/install | 67 // 5. InstallUIProceed: initiates the .crx download/install |
68 // | 68 // |
69 // All flows (whether successful or not) end up in CompleteInstall, which | 69 // All flows (whether successful or not) end up in CompleteInstall, which |
70 // informs our delegate of success/failure. | 70 // informs our delegate of success/failure. |
71 | 71 |
72 // content::URLFetcherDelegate interface implementation. | 72 // content::URLFetcherDelegate interface implementation. |
73 virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE; | 73 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; |
74 | 74 |
75 // Client callbacks for SafeWebstoreResponseParser when parsing is complete. | 75 // Client callbacks for SafeWebstoreResponseParser when parsing is complete. |
76 void OnWebstoreResponseParseSuccess(DictionaryValue* webstore_data); | 76 void OnWebstoreResponseParseSuccess(DictionaryValue* webstore_data); |
77 void OnWebstoreResponseParseFailure(const std::string& error); | 77 void OnWebstoreResponseParseFailure(const std::string& error); |
78 | 78 |
79 // WebstoreInstallHelper::Delegate interface implementation. | 79 // WebstoreInstallHelper::Delegate interface implementation. |
80 virtual void OnWebstoreParseSuccess( | 80 virtual void OnWebstoreParseSuccess( |
81 const SkBitmap& icon, | 81 const SkBitmap& icon, |
82 base::DictionaryValue* parsed_manifest) OVERRIDE; | 82 base::DictionaryValue* parsed_manifest) OVERRIDE; |
83 virtual void OnWebstoreParseFailure( | 83 virtual void OnWebstoreParseFailure( |
(...skipping 13 matching lines...) Expand all Loading... |
97 const std::string& error) OVERRIDE; | 97 const std::string& error) OVERRIDE; |
98 | 98 |
99 void CompleteInstall(const std::string& error); | 99 void CompleteInstall(const std::string& error); |
100 | 100 |
101 int install_id_; | 101 int install_id_; |
102 std::string id_; | 102 std::string id_; |
103 GURL requestor_url_; | 103 GURL requestor_url_; |
104 Delegate* delegate_; | 104 Delegate* delegate_; |
105 | 105 |
106 // For fetching webstore JSON data. | 106 // For fetching webstore JSON data. |
107 scoped_ptr<URLFetcher> webstore_data_url_fetcher_; | 107 scoped_ptr<content::URLFetcher> webstore_data_url_fetcher_; |
108 | 108 |
109 // Extracted from the webstore JSON data response. | 109 // Extracted from the webstore JSON data response. |
110 std::string localized_name_; | 110 std::string localized_name_; |
111 std::string localized_description_; | 111 std::string localized_description_; |
112 std::string localized_user_count_; | 112 std::string localized_user_count_; |
113 double average_rating_; | 113 double average_rating_; |
114 int rating_count_; | 114 int rating_count_; |
115 scoped_ptr<DictionaryValue> webstore_data_; | 115 scoped_ptr<DictionaryValue> webstore_data_; |
116 scoped_ptr<DictionaryValue> manifest_; | 116 scoped_ptr<DictionaryValue> manifest_; |
117 scoped_refptr<Extension> dummy_extension_; | 117 scoped_refptr<Extension> dummy_extension_; |
118 SkBitmap icon_; | 118 SkBitmap icon_; |
119 | 119 |
120 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); | 120 DISALLOW_IMPLICIT_CONSTRUCTORS(WebstoreInlineInstaller); |
121 }; | 121 }; |
122 | 122 |
123 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ | 123 #endif // CHROME_BROWSER_EXTENSIONS_WEBSTORE_INLINE_INSTALLER_H_ |
OLD | NEW |