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

Side by Side Diff: chrome/browser/sync/profile_sync_service_harness.cc

Issue 11817045: Move auth-error reporting code out of SyncGlobalError and into SigninGlobalError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disabled ExtensionActionContextMenuTest.BrowserAction Created 7 years, 11 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/sync/profile_sync_service_harness.h" 5 #include "chrome/browser/sync/profile_sync_service_harness.h"
6 6
7 #include <cstddef> 7 #include <cstddef>
8 #include <iterator> 8 #include <iterator>
9 #include <ostream> 9 #include <ostream>
10 #include <set> 10 #include <set>
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 waiting_for_status_change_(false) { 114 waiting_for_status_change_(false) {
115 if (IsSyncAlreadySetup()) { 115 if (IsSyncAlreadySetup()) {
116 service_ = ProfileSyncServiceFactory::GetInstance()->GetForProfile( 116 service_ = ProfileSyncServiceFactory::GetInstance()->GetForProfile(
117 profile_); 117 profile_);
118 service_->AddObserver(this); 118 service_->AddObserver(this);
119 ignore_result(TryListeningToMigrationEvents()); 119 ignore_result(TryListeningToMigrationEvents());
120 wait_state_ = FULLY_SYNCED; 120 wait_state_ = FULLY_SYNCED;
121 } 121 }
122 } 122 }
123 123
124 ProfileSyncServiceHarness::~ProfileSyncServiceHarness() {} 124 ProfileSyncServiceHarness::~ProfileSyncServiceHarness() {
125 if (service_->HasObserver(this))
126 service_->RemoveObserver(this);
127 }
125 128
126 // static 129 // static
127 ProfileSyncServiceHarness* ProfileSyncServiceHarness::CreateAndAttach( 130 ProfileSyncServiceHarness* ProfileSyncServiceHarness::CreateAndAttach(
128 Profile* profile) { 131 Profile* profile) {
129 ProfileSyncServiceFactory* f = ProfileSyncServiceFactory::GetInstance(); 132 ProfileSyncServiceFactory* f = ProfileSyncServiceFactory::GetInstance();
130 if (!f->HasProfileSyncService(profile)) { 133 if (!f->HasProfileSyncService(profile)) {
131 NOTREACHED() << "Profile has never signed into sync."; 134 NOTREACHED() << "Profile has never signed into sync.";
132 return NULL; 135 return NULL;
133 } 136 }
134 return new ProfileSyncServiceHarness(profile, "", ""); 137 return new ProfileSyncServiceHarness(profile, "", "");
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 1125
1123 std::string ProfileSyncServiceHarness::GetServiceStatus() { 1126 std::string ProfileSyncServiceHarness::GetServiceStatus() {
1124 scoped_ptr<DictionaryValue> value( 1127 scoped_ptr<DictionaryValue> value(
1125 sync_ui_util::ConstructAboutInformation(service_)); 1128 sync_ui_util::ConstructAboutInformation(service_));
1126 std::string service_status; 1129 std::string service_status;
1127 base::JSONWriter::WriteWithOptions(value.get(), 1130 base::JSONWriter::WriteWithOptions(value.get(),
1128 base::JSONWriter::OPTIONS_PRETTY_PRINT, 1131 base::JSONWriter::OPTIONS_PRETTY_PRINT,
1129 &service_status); 1132 &service_status);
1130 return service_status; 1133 return service_status;
1131 } 1134 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service.cc ('k') | chrome/browser/sync/profile_sync_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698