| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ | 6 #define CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 void OnWebstoreParseSuccess(const SkBitmap& icon, | 120 void OnWebstoreParseSuccess(const SkBitmap& icon, |
| 121 const std::string& required_platform_version); | 121 const std::string& required_platform_version); |
| 122 void OnWebstoreParseFailure(); | 122 void OnWebstoreParseFailure(); |
| 123 | 123 |
| 124 // Starts to fetch data from web store. | 124 // Starts to fetch data from web store. |
| 125 void StartFetch(); | 125 void StartFetch(); |
| 126 | 126 |
| 127 // extensions::WebstoreDataFetcherDelegate overrides: | 127 // extensions::WebstoreDataFetcherDelegate overrides: |
| 128 void OnWebstoreRequestFailure() override; | 128 void OnWebstoreRequestFailure() override; |
| 129 void OnWebstoreResponseParseSuccess( | 129 void OnWebstoreResponseParseSuccess( |
| 130 scoped_ptr<base::DictionaryValue> webstore_data) override; | 130 std::unique_ptr<base::DictionaryValue> webstore_data) override; |
| 131 void OnWebstoreResponseParseFailure(const std::string& error) override; | 131 void OnWebstoreResponseParseFailure(const std::string& error) override; |
| 132 | 132 |
| 133 // Helper function for testing for the existence of |key| in | 133 // Helper function for testing for the existence of |key| in |
| 134 // |response|. Passes |key|'s content via |value| and returns | 134 // |response|. Passes |key|'s content via |value| and returns |
| 135 // true when |key| is present. | 135 // true when |key| is present. |
| 136 bool CheckResponseKeyValue(const base::DictionaryValue* response, | 136 bool CheckResponseKeyValue(const base::DictionaryValue* response, |
| 137 const char* key, | 137 const char* key, |
| 138 std::string* value); | 138 std::string* value); |
| 139 | 139 |
| 140 // Extracts meta data from crx file when loading from Webstore and local | 140 // Extracts meta data from crx file when loading from Webstore and local |
| 141 // cache fails. | 141 // cache fails. |
| 142 void LoadFromCrx(); | 142 void LoadFromCrx(); |
| 143 | 143 |
| 144 void OnCrxLoadFinished(const CrxLoader* crx_loader); | 144 void OnCrxLoadFinished(const CrxLoader* crx_loader); |
| 145 | 145 |
| 146 KioskAppDataDelegate* delegate_; // not owned. | 146 KioskAppDataDelegate* delegate_; // not owned. |
| 147 Status status_; | 147 Status status_; |
| 148 | 148 |
| 149 std::string app_id_; | 149 std::string app_id_; |
| 150 AccountId account_id_; | 150 AccountId account_id_; |
| 151 std::string name_; | 151 std::string name_; |
| 152 GURL update_url_; | 152 GURL update_url_; |
| 153 gfx::ImageSkia icon_; | 153 gfx::ImageSkia icon_; |
| 154 std::string required_platform_version_; | 154 std::string required_platform_version_; |
| 155 | 155 |
| 156 scoped_ptr<extensions::WebstoreDataFetcher> webstore_fetcher_; | 156 std::unique_ptr<extensions::WebstoreDataFetcher> webstore_fetcher_; |
| 157 base::FilePath icon_path_; | 157 base::FilePath icon_path_; |
| 158 | 158 |
| 159 base::FilePath crx_file_; | 159 base::FilePath crx_file_; |
| 160 | 160 |
| 161 DISALLOW_COPY_AND_ASSIGN(KioskAppData); | 161 DISALLOW_COPY_AND_ASSIGN(KioskAppData); |
| 162 }; | 162 }; |
| 163 | 163 |
| 164 } // namespace chromeos | 164 } // namespace chromeos |
| 165 | 165 |
| 166 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ | 166 #endif // CHROME_BROWSER_CHROMEOS_APP_MODE_KIOSK_APP_DATA_H_ |
| OLD | NEW |