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

Side by Side Diff: chrome/browser/extensions/api/push_messaging/sync_setup_helper.cc

Issue 17911005: Merge 208347 "Revert 208315 "Make use of InvalidationService"" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1547/src/
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/extensions/api/push_messaging/sync_setup_helper.h" 5 #include "chrome/browser/extensions/api/push_messaging/sync_setup_helper.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 11 matching lines...) Expand all
22 #include "testing/gtest/include/gtest/gtest.h" 22 #include "testing/gtest/include/gtest/gtest.h"
23 23
24 namespace extensions { 24 namespace extensions {
25 25
26 SyncSetupHelper::SyncSetupHelper() {} 26 SyncSetupHelper::SyncSetupHelper() {}
27 27
28 SyncSetupHelper::~SyncSetupHelper() {} 28 SyncSetupHelper::~SyncSetupHelper() {}
29 29
30 bool SyncSetupHelper::InitializeSync(Profile* profile) { 30 bool SyncSetupHelper::InitializeSync(Profile* profile) {
31 profile_ = profile; 31 profile_ = profile;
32 client_.reset( 32 client_.reset(new ProfileSyncServiceHarness(profile_, username_, password_));
33 ProfileSyncServiceHarness::Create(profile_, username_, password_));
34 33
35 if (client_->service()->IsSyncEnabledAndLoggedIn()) 34 if (client_->service()->IsSyncEnabledAndLoggedIn())
36 return true; 35 return true;
37 36
38 if (!client_->SetupSync()) 37 if (!client_->SetupSync())
39 return false; 38 return false;
40 39
41 // Because clients may modify sync data as part of startup (for example local 40 // Because clients may modify sync data as part of startup (for example local
42 // session-releated data is rewritten), we need to ensure all startup-based 41 // session-releated data is rewritten), we need to ensure all startup-based
43 // changes have propagated between the clients. 42 // changes have propagated between the clients.
(...skipping 29 matching lines...) Expand all
73 return true; 72 return true;
74 } 73 }
75 74
76 bool SyncSetupHelper::AwaitQuiescence() { 75 bool SyncSetupHelper::AwaitQuiescence() {
77 std::vector<ProfileSyncServiceHarness*> clients; 76 std::vector<ProfileSyncServiceHarness*> clients;
78 clients.push_back(client_.get()); 77 clients.push_back(client_.get());
79 return ProfileSyncServiceHarness::AwaitQuiescence(clients); 78 return ProfileSyncServiceHarness::AwaitQuiescence(clients);
80 } 79 }
81 80
82 } // namespace extensions 81 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698