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_INSTALL_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALL_SERVICE_H_ |
6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALL_SERVICE_H_ | 6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALL_SERVICE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/callback.h" | 12 #include "base/callback.h" |
13 #include "base/macros.h" | 13 #include "base/macros.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "components/keyed_service/core/keyed_service.h" | 15 #include "components/keyed_service/core/keyed_service.h" |
16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 class BrowserContext; | 19 class BrowserContext; |
20 } | 20 } |
21 | 21 |
22 struct ShortcutInfo; | 22 struct ShortcutInfo; |
23 class SkBitmap; | 23 class SkBitmap; |
24 | 24 |
25 // A Java counterpart will be generated for this enum. | 25 // A Java counterpart will be generated for this enum. |
26 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.webapps | 26 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.webapps |
27 enum class WebApkInstallResult { | 27 enum class WebApkInstallResult { |
28 SUCCESS = 0, | 28 SUCCESS = 0, |
29 FAILURE = 1, | 29 FAILURE = 1, |
30 // An install was initiated but it timed out. We did not get a response from | 30 // Deprecated: PROBABLE_FAILURE = 2 |
31 // Google Play (or the Android OS in the case of the "unknown sources" flow) | |
32 // so it is possible that the install will complete some time in the future. | |
33 PROBABLE_FAILURE = 2 | |
34 }; | 31 }; |
35 | 32 |
36 // Service which talks to Chrome WebAPK server and Google Play to generate a | 33 // Service which talks to Chrome WebAPK server and Google Play to generate a |
37 // WebAPK on the server, download it, and install it. | 34 // WebAPK on the server, download it, and install it. |
38 class WebApkInstallService : public KeyedService { | 35 class WebApkInstallService : public KeyedService { |
39 public: | 36 public: |
40 // Called when the creation/updating of a WebAPK is finished or failed. | 37 // Called when the creation/updating of a WebAPK is finished or failed. |
41 // Parameters: | 38 // Parameters: |
42 // - the result of the installation. | 39 // - the result of the installation. |
43 // - true if Chrome received a "request updates less frequently" directive. | 40 // - true if Chrome received a "request updates less frequently" directive. |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // In progress installs. | 83 // In progress installs. |
87 std::set<GURL> installs_; | 84 std::set<GURL> installs_; |
88 | 85 |
89 // Used to get |weak_ptr_|. | 86 // Used to get |weak_ptr_|. |
90 base::WeakPtrFactory<WebApkInstallService> weak_ptr_factory_; | 87 base::WeakPtrFactory<WebApkInstallService> weak_ptr_factory_; |
91 | 88 |
92 DISALLOW_COPY_AND_ASSIGN(WebApkInstallService); | 89 DISALLOW_COPY_AND_ASSIGN(WebApkInstallService); |
93 }; | 90 }; |
94 | 91 |
95 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALL_SERVICE_H_ | 92 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_INSTALL_SERVICE_H_ |
OLD | NEW |