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 #include "chrome/browser/android/background_sync_launcher_android.h" | 5 #include "chrome/browser/android/background_sync_launcher_android.h" |
6 | 6 |
7 #include "base/android/context_utils.h" | 7 #include "base/android/context_utils.h" |
8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
9 #include "jni/BackgroundSyncLauncher_jni.h" | 9 #include "jni/BackgroundSyncLauncher_jni.h" |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 Get()->LaunchBrowserIfStoppedImpl(launch_when_next_online, min_delay_ms); | 37 Get()->LaunchBrowserIfStoppedImpl(launch_when_next_online, min_delay_ms); |
38 } | 38 } |
39 | 39 |
40 void BackgroundSyncLauncherAndroid::LaunchBrowserIfStoppedImpl( | 40 void BackgroundSyncLauncherAndroid::LaunchBrowserIfStoppedImpl( |
41 bool launch_when_next_online, | 41 bool launch_when_next_online, |
42 int64_t min_delay_ms) { | 42 int64_t min_delay_ms) { |
43 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 43 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
44 | 44 |
45 JNIEnv* env = base::android::AttachCurrentThread(); | 45 JNIEnv* env = base::android::AttachCurrentThread(); |
46 Java_BackgroundSyncLauncher_launchBrowserIfStopped( | 46 Java_BackgroundSyncLauncher_launchBrowserIfStopped( |
47 env, java_launcher_, base::android::GetApplicationContext(), | 47 env, java_launcher_, launch_when_next_online, min_delay_ms); |
48 launch_when_next_online, min_delay_ms); | |
49 } | 48 } |
50 | 49 |
51 // static | 50 // static |
52 void BackgroundSyncLauncherAndroid::SetPlayServicesVersionCheckDisabledForTests( | 51 void BackgroundSyncLauncherAndroid::SetPlayServicesVersionCheckDisabledForTests( |
53 bool disabled) { | 52 bool disabled) { |
54 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 53 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
55 disable_play_services_version_check_for_tests = disabled; | 54 disable_play_services_version_check_for_tests = disabled; |
56 } | 55 } |
57 | 56 |
58 // static | 57 // static |
(...skipping 14 matching lines...) Expand all Loading... |
73 java_launcher_.Reset(Java_BackgroundSyncLauncher_create( | 72 java_launcher_.Reset(Java_BackgroundSyncLauncher_create( |
74 env, base::android::GetApplicationContext())); | 73 env, base::android::GetApplicationContext())); |
75 } | 74 } |
76 | 75 |
77 BackgroundSyncLauncherAndroid::~BackgroundSyncLauncherAndroid() { | 76 BackgroundSyncLauncherAndroid::~BackgroundSyncLauncherAndroid() { |
78 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 77 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
79 | 78 |
80 JNIEnv* env = base::android::AttachCurrentThread(); | 79 JNIEnv* env = base::android::AttachCurrentThread(); |
81 Java_BackgroundSyncLauncher_destroy(env, java_launcher_); | 80 Java_BackgroundSyncLauncher_destroy(env, java_launcher_); |
82 } | 81 } |
OLD | NEW |