Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_INSTALLABLE_INSTALLABLE_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ |
| 6 #define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ | 6 #define CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 // Methods coordinating and dispatching work for the current task. | 150 // Methods coordinating and dispatching work for the current task. |
| 151 void RunCallback(const Task& task, InstallableStatusCode error); | 151 void RunCallback(const Task& task, InstallableStatusCode error); |
| 152 void StartNextTask(); | 152 void StartNextTask(); |
| 153 void WorkOnTask(); | 153 void WorkOnTask(); |
| 154 | 154 |
| 155 // Data retrieval methods. | 155 // Data retrieval methods. |
| 156 void FetchManifest(); | 156 void FetchManifest(); |
| 157 void OnDidGetManifest(const GURL& manifest_url, | 157 void OnDidGetManifest(const GURL& manifest_url, |
| 158 const content::Manifest& manifest); | 158 const content::Manifest& manifest); |
| 159 | 159 |
| 160 // Methods checking for InstallableParams-independent basic requirements. | |
|
dominickn
2016/10/27 00:26:36
This comment isn't accurate. CheckServiceWorker()
F
2016/10/27 17:49:24
Thanks for pointing out the check_installable bit!
| |
| 160 void CheckInstallable(); | 161 void CheckInstallable(); |
| 161 bool IsManifestValidForWebApp(const content::Manifest& manifest); | 162 bool IsManifestValidForWebApp(const content::Manifest& manifest); |
| 162 void CheckServiceWorker(); | 163 void CheckServiceWorker(); |
| 163 void OnDidCheckHasServiceWorker(bool has_service_worker); | 164 void OnDidCheckHasServiceWorker(bool has_service_worker); |
| 164 | 165 |
| 166 // Methods checking for requirements specified by InstallableParams. | |
| 165 void CheckAndFetchBestIcon(); | 167 void CheckAndFetchBestIcon(); |
| 166 void OnAppIconFetched(const GURL icon_url, const SkBitmap& bitmap); | 168 void OnAppIconFetched(const GURL icon_url, const SkBitmap& bitmap); |
| 167 | 169 |
| 168 // content::WebContentsObserver overrides | 170 // content::WebContentsObserver overrides |
| 169 void DidFinishNavigation(content::NavigationHandle* handle) override; | 171 void DidFinishNavigation(content::NavigationHandle* handle) override; |
| 170 void WebContentsDestroyed() override; | 172 void WebContentsDestroyed() override; |
| 171 | 173 |
| 172 const GURL& manifest_url() const; | 174 const GURL& manifest_url() const; |
| 173 const content::Manifest& manifest() const; | 175 const content::Manifest& manifest() const; |
| 174 bool is_installable() const; | 176 bool is_installable() const; |
| 175 | 177 |
| 176 // The list of <params, callback> pairs that have come from a call to GetData. | 178 // The list of <params, callback> pairs that have come from a call to GetData. |
| 177 std::vector<Task> tasks_; | 179 std::vector<Task> tasks_; |
| 178 | 180 |
| 179 // Installable properties cached on this object. | 181 // Installable properties cached on this object. |
| 180 std::unique_ptr<ManifestProperty> manifest_; | 182 std::unique_ptr<ManifestProperty> manifest_; |
| 181 std::unique_ptr<InstallableProperty> installable_; | 183 std::unique_ptr<InstallableProperty> installable_; |
| 182 std::map<IconParams, IconProperty> icons_; | 184 std::map<IconParams, IconProperty> icons_; |
| 183 | 185 |
| 184 bool is_active_; | 186 bool is_active_; |
| 185 | 187 |
| 186 base::WeakPtrFactory<InstallableManager> weak_factory_; | 188 base::WeakPtrFactory<InstallableManager> weak_factory_; |
| 187 | 189 |
| 188 DISALLOW_COPY_AND_ASSIGN(InstallableManager); | 190 DISALLOW_COPY_AND_ASSIGN(InstallableManager); |
| 189 }; | 191 }; |
| 190 | 192 |
| 191 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ | 193 #endif // CHROME_BROWSER_INSTALLABLE_INSTALLABLE_MANAGER_H_ |
| OLD | NEW |