Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: chrome/browser/background_sync/background_sync_controller_impl.cc

Issue 1324173002: [Background Sync] Use GcmNetworkManager to start the browser for sync events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@bgsync-fix-background5
Patch Set: Make BackgroundSyncLauncher testable Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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)
12 #include "chrome/browser/android/background_sync_launcher_android.h"
13 #endif
14
11 BackgroundSyncControllerImpl::BackgroundSyncControllerImpl(Profile* profile) 15 BackgroundSyncControllerImpl::BackgroundSyncControllerImpl(Profile* profile)
12 : profile_(profile) {} 16 : profile_(profile) {}
13 17
14 BackgroundSyncControllerImpl::~BackgroundSyncControllerImpl() = default; 18 BackgroundSyncControllerImpl::~BackgroundSyncControllerImpl() = default;
15 19
16 rappor::RapporService* BackgroundSyncControllerImpl::GetRapporService() { 20 rappor::RapporService* BackgroundSyncControllerImpl::GetRapporService() {
17 return g_browser_process->rappor_service(); 21 return g_browser_process->rappor_service();
18 } 22 }
19 23
20 void BackgroundSyncControllerImpl::NotifyBackgroundSyncRegistered( 24 void BackgroundSyncControllerImpl::NotifyBackgroundSyncRegistered(
21 const GURL& origin) { 25 const GURL& origin) {
22 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 26 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
23 DCHECK_EQ(origin, origin.GetOrigin()); 27 DCHECK_EQ(origin, origin.GetOrigin());
24 28
25 if (profile_->IsOffTheRecord()) 29 if (profile_->IsOffTheRecord())
26 return; 30 return;
27 31
28 rappor::SampleDomainAndRegistryFromGURL( 32 rappor::SampleDomainAndRegistryFromGURL(
29 GetRapporService(), "BackgroundSync.Register.Origin", origin); 33 GetRapporService(), "BackgroundSync.Register.Origin", origin);
30 } 34 }
35
36 #if defined(OS_ANDROID)
37 void BackgroundSyncControllerImpl::LaunchBrowserWhenNextOnline(
38 const content::BackgroundSyncManager* registrant,
39 bool launch_when_next_online) {
40 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
41 BackgroundSyncLauncherAndroid::LaunchBrowserWhenNextOnline(
42 registrant, launch_when_next_online);
43 }
44 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698