Chromium Code Reviews| 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/background_sync/background_sync_controller_impl.h" | 5 #include "chrome/browser/background_sync/background_sync_controller_impl.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser_process.h" | 7 #include "chrome/browser/browser_process.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "components/rappor/rappor_utils.h" | 9 #include "components/rappor/rappor_utils.h" |
| 10 | 10 |
| 11 #if defined(OS_ANDROID) | 11 #if defined(ANDROID_JAVA_UI) |
|
Ted C
2015/11/30 19:39:05
This class doesn't seem UI related either. Don't
no sievers
2015/11/30 23:56:34
I think eventually we probably want it, but it nee
| |
| 12 #include "chrome/browser/android/background_sync_launcher_android.h" | 12 #include "chrome/browser/android/background_sync_launcher_android.h" |
| 13 #endif | 13 #endif |
| 14 | 14 |
| 15 BackgroundSyncControllerImpl::BackgroundSyncControllerImpl(Profile* profile) | 15 BackgroundSyncControllerImpl::BackgroundSyncControllerImpl(Profile* profile) |
| 16 : profile_(profile) {} | 16 : profile_(profile) {} |
| 17 | 17 |
| 18 BackgroundSyncControllerImpl::~BackgroundSyncControllerImpl() = default; | 18 BackgroundSyncControllerImpl::~BackgroundSyncControllerImpl() = default; |
| 19 | 19 |
| 20 rappor::RapporService* BackgroundSyncControllerImpl::GetRapporService() { | 20 rappor::RapporService* BackgroundSyncControllerImpl::GetRapporService() { |
| 21 return g_browser_process->rappor_service(); | 21 return g_browser_process->rappor_service(); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 32 rappor::SampleDomainAndRegistryFromGURL( | 32 rappor::SampleDomainAndRegistryFromGURL( |
| 33 GetRapporService(), "BackgroundSync.Register.Origin", origin); | 33 GetRapporService(), "BackgroundSync.Register.Origin", origin); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void BackgroundSyncControllerImpl::RunInBackground(bool enabled, | 36 void BackgroundSyncControllerImpl::RunInBackground(bool enabled, |
| 37 int64_t min_ms) { | 37 int64_t min_ms) { |
| 38 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 38 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 39 | 39 |
| 40 if (profile_->IsOffTheRecord()) | 40 if (profile_->IsOffTheRecord()) |
| 41 return; | 41 return; |
| 42 #if defined(OS_ANDROID) | 42 #if defined(ANDROID_JAVA_UI) |
| 43 BackgroundSyncLauncherAndroid::LaunchBrowserIfStopped(enabled, min_ms); | 43 BackgroundSyncLauncherAndroid::LaunchBrowserIfStopped(enabled, min_ms); |
| 44 #else | 44 #else |
| 45 // TODO(jkarlin): Use BackgroundModeManager to enter background mode. See | 45 // TODO(jkarlin): Use BackgroundModeManager to enter background mode. See |
| 46 // https://crbug.com/484201. | 46 // https://crbug.com/484201. |
| 47 #endif | 47 #endif |
| 48 } | 48 } |
| OLD | NEW |