OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BACKGROUND_SYNC_LAUNCHER_ANDROID_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_BACKGROUND_SYNC_LAUNCHER_ANDROID_H_ |
6 #define CHROME_BROWSER_ANDROID_BACKGROUND_SYNC_LAUNCHER_ANDROID_H_ | 6 #define CHROME_BROWSER_ANDROID_BACKGROUND_SYNC_LAUNCHER_ANDROID_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <set> | 10 #include <set> |
(...skipping 12 matching lines...) Expand all Loading... |
23 // BackgroundSyncLauncher object and is used to register interest in starting | 23 // BackgroundSyncLauncher object and is used to register interest in starting |
24 // the browser the next time the device goes online. This class runs on the UI | 24 // the browser the next time the device goes online. This class runs on the UI |
25 // thread. | 25 // thread. |
26 class BackgroundSyncLauncherAndroid { | 26 class BackgroundSyncLauncherAndroid { |
27 public: | 27 public: |
28 static BackgroundSyncLauncherAndroid* Get(); | 28 static BackgroundSyncLauncherAndroid* Get(); |
29 | 29 |
30 static void LaunchBrowserIfStopped(bool launch_when_next_online, | 30 static void LaunchBrowserIfStopped(bool launch_when_next_online, |
31 int64_t min_delay_ms); | 31 int64_t min_delay_ms); |
32 | 32 |
33 static bool RegisterLauncher(JNIEnv* env); | |
34 | |
35 static bool ShouldDisableBackgroundSync(); | 33 static bool ShouldDisableBackgroundSync(); |
36 | 34 |
37 // TODO(iclelland): Remove this once the bots have their play services package | 35 // TODO(iclelland): Remove this once the bots have their play services package |
38 // updated before every test run. (https://crbug.com/514449) | 36 // updated before every test run. (https://crbug.com/514449) |
39 static void SetPlayServicesVersionCheckDisabledForTests(bool disabled); | 37 static void SetPlayServicesVersionCheckDisabledForTests(bool disabled); |
40 | 38 |
41 private: | 39 private: |
42 friend struct base::DefaultLazyInstanceTraits<BackgroundSyncLauncherAndroid>; | 40 friend struct base::DefaultLazyInstanceTraits<BackgroundSyncLauncherAndroid>; |
43 | 41 |
44 // Constructor and destructor marked private to enforce singleton | 42 // Constructor and destructor marked private to enforce singleton |
45 BackgroundSyncLauncherAndroid(); | 43 BackgroundSyncLauncherAndroid(); |
46 ~BackgroundSyncLauncherAndroid(); | 44 ~BackgroundSyncLauncherAndroid(); |
47 | 45 |
48 void LaunchBrowserIfStoppedImpl(bool launch_when_next_online, | 46 void LaunchBrowserIfStoppedImpl(bool launch_when_next_online, |
49 int64_t min_delay_ms); | 47 int64_t min_delay_ms); |
50 | 48 |
51 base::android::ScopedJavaGlobalRef<jobject> java_launcher_; | 49 base::android::ScopedJavaGlobalRef<jobject> java_launcher_; |
52 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncLauncherAndroid); | 50 DISALLOW_COPY_AND_ASSIGN(BackgroundSyncLauncherAndroid); |
53 }; | 51 }; |
54 | 52 |
55 #endif // CHROME_BROWSER_ANDROID_BACKGROUND_SYNC_LAUNCHER_ANDROID_H_ | 53 #endif // CHROME_BROWSER_ANDROID_BACKGROUND_SYNC_LAUNCHER_ANDROID_H_ |
OLD | NEW |