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_.obj(), base::android::GetApplicationContext(), | 47 env, java_launcher_, base::android::GetApplicationContext(), |
48 launch_when_next_online, min_delay_ms); | 48 launch_when_next_online, min_delay_ms); |
49 } | 49 } |
50 | 50 |
51 // static | 51 // static |
52 void BackgroundSyncLauncherAndroid::SetPlayServicesVersionCheckDisabledForTests( | 52 void BackgroundSyncLauncherAndroid::SetPlayServicesVersionCheckDisabledForTests( |
53 bool disabled) { | 53 bool disabled) { |
54 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 54 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
55 disable_play_services_version_check_for_tests = disabled; | 55 disable_play_services_version_check_for_tests = disabled; |
56 } | 56 } |
57 | 57 |
(...skipping 13 matching lines...) Expand all Loading... |
71 | 71 |
72 JNIEnv* env = base::android::AttachCurrentThread(); | 72 JNIEnv* env = base::android::AttachCurrentThread(); |
73 java_launcher_.Reset(Java_BackgroundSyncLauncher_create( | 73 java_launcher_.Reset(Java_BackgroundSyncLauncher_create( |
74 env, base::android::GetApplicationContext())); | 74 env, base::android::GetApplicationContext())); |
75 } | 75 } |
76 | 76 |
77 BackgroundSyncLauncherAndroid::~BackgroundSyncLauncherAndroid() { | 77 BackgroundSyncLauncherAndroid::~BackgroundSyncLauncherAndroid() { |
78 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 78 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
79 | 79 |
80 JNIEnv* env = base::android::AttachCurrentThread(); | 80 JNIEnv* env = base::android::AttachCurrentThread(); |
81 Java_BackgroundSyncLauncher_destroy(env, java_launcher_.obj()); | 81 Java_BackgroundSyncLauncher_destroy(env, java_launcher_); |
82 } | 82 } |
OLD | NEW |