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_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // Same as InstallAsync() but uses the passed in |request_context_getter|. | 57 // Same as InstallAsync() but uses the passed in |request_context_getter|. |
58 void InstallAsyncWithURLRequestContextGetter( | 58 void InstallAsyncWithURLRequestContextGetter( |
59 net::URLRequestContextGetter* request_context_getter, | 59 net::URLRequestContextGetter* request_context_getter, |
60 const FinishCallback& callback); | 60 const FinishCallback& callback); |
61 | 61 |
62 // Talks to the Chrome WebAPK server to update a WebAPK on the server and to | 62 // Talks to the Chrome WebAPK server to update a WebAPK on the server and to |
63 // the Google Play server to install the downloaded WebAPK. Calls |callback| | 63 // the Google Play server to install the downloaded WebAPK. Calls |callback| |
64 // after the request to install the WebAPK is sent to the Google Play server. | 64 // after the request to install the WebAPK is sent to the Google Play server. |
65 void UpdateAsync(content::BrowserContext* browser_context, | 65 void UpdateAsync(content::BrowserContext* browser_context, |
66 const FinishCallback& callback, | 66 const FinishCallback& callback, |
| 67 const std::string& icon_murmur2_hash, |
67 const std::string& webapk_package, | 68 const std::string& webapk_package, |
68 int webapk_version); | 69 int webapk_version); |
69 | 70 |
70 // Same as UpdateAsync() but uses the passed in |request_context_getter|. | 71 // Same as UpdateAsync() but uses the passed in |request_context_getter|. |
71 void UpdateAsyncWithURLRequestContextGetter( | 72 void UpdateAsyncWithURLRequestContextGetter( |
72 net::URLRequestContextGetter* request_context_getter, | 73 net::URLRequestContextGetter* request_context_getter, |
73 const FinishCallback& callback, | 74 const FinishCallback& callback, |
| 75 const std::string& icon_murmur2_hash, |
74 const std::string& webapk_package, | 76 const std::string& webapk_package, |
75 int webapk_version); | 77 int webapk_version); |
76 | 78 |
77 // Sets the timeout for the server requests. | 79 // Sets the timeout for the server requests. |
78 void SetTimeoutMs(int timeout_ms); | 80 void SetTimeoutMs(int timeout_ms); |
79 | 81 |
80 protected: | 82 protected: |
81 // Starts installation of the downloaded WebAPK. Returns whether the install | 83 // Starts installation of the downloaded WebAPK. Returns whether the install |
82 // could be started. The installation may still fail if true is returned. | 84 // could be started. The installation may still fail if true is returned. |
83 // |file_path| is the file path that the WebAPK was downloaded to. | 85 // |file_path| is the file path that the WebAPK was downloaded to. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // Indicates whether the installer is for installing or updating a WebAPK. | 214 // Indicates whether the installer is for installing or updating a WebAPK. |
213 TaskType task_type_; | 215 TaskType task_type_; |
214 | 216 |
215 // Used to get |weak_ptr_|. | 217 // Used to get |weak_ptr_|. |
216 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; | 218 base::WeakPtrFactory<WebApkInstaller> weak_ptr_factory_; |
217 | 219 |
218 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); | 220 DISALLOW_COPY_AND_ASSIGN(WebApkInstaller); |
219 }; | 221 }; |
220 | 222 |
221 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ | 223 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALLER_H_ |
OLD | NEW |