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

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

Issue 6461024: Revert 74292 - Splits ChromeURLDataManager into 2 chunks:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/sync_setup_wizard.h" 5 #include "chrome/browser/sync/sync_setup_wizard.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "chrome/browser/browser_thread.h" 9 #include "chrome/browser/browser_thread.h"
10 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" 10 #include "chrome/browser/dom_ui/chrome_url_data_manager.h"
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 GURL original_url(url); 253 GURL original_url(url);
254 DCHECK(original_url.is_valid()); 254 DCHECK(original_url.is_valid());
255 GURL localized_url = google_util::AppendGoogleLocaleParam(original_url); 255 GURL localized_url = google_util::AppendGoogleLocaleParam(original_url);
256 return localized_url.spec(); 256 return localized_url.spec();
257 } 257 }
258 258
259 SyncSetupWizard::SyncSetupWizard(ProfileSyncService* service) 259 SyncSetupWizard::SyncSetupWizard(ProfileSyncService* service)
260 : service_(service), 260 : service_(service),
261 flow_container_(new SyncSetupFlowContainer()), 261 flow_container_(new SyncSetupFlowContainer()),
262 parent_window_(NULL) { 262 parent_window_(NULL) {
263 // If we're in a unit test, we may not have an IO thread or profile. Avoid 263 // If we're in a unit test, we may not have an IO thread. Avoid
264 // creating a SyncResourcesSource since we may leak it (since it's 264 // creating a SyncResourcesSource since we may leak it (since it's
265 // DeleteOnUIThread). 265 // DeleteOnUIThread).
266 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO) && 266 if (BrowserThread::IsMessageLoopValid(BrowserThread::IO)) {
267 service_->profile()) {
268 // Add our network layer data source for 'cloudy' URLs. 267 // Add our network layer data source for 'cloudy' URLs.
269 SyncResourcesSource* sync_source = new SyncResourcesSource(); 268 SyncResourcesSource* sync_source = new SyncResourcesSource();
270 service_->profile()->GetChromeURLDataManager()->AddDataSource(sync_source); 269 bool posted =
270 BrowserThread::PostTask(
271 BrowserThread::IO, FROM_HERE,
272 NewRunnableMethod(ChromeURLDataManager::GetInstance(),
273 &ChromeURLDataManager::AddDataSource,
274 make_scoped_refptr(sync_source)));
275 DCHECK(posted);
271 } 276 }
272 } 277 }
273 278
274 SyncSetupWizard::~SyncSetupWizard() { 279 SyncSetupWizard::~SyncSetupWizard() {
275 delete flow_container_; 280 delete flow_container_;
276 } 281 }
277 282
278 void SyncSetupWizard::Step(State advance_state) { 283 void SyncSetupWizard::Step(State advance_state) {
279 SyncSetupFlow* flow = flow_container_->get_flow(); 284 SyncSetupFlow* flow = flow_container_->get_flow();
280 if (flow) { 285 if (flow) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 result = GAIA_SUCCESS; 337 result = GAIA_SUCCESS;
333 } else if (start_state == ENTER_PASSPHRASE || 338 } else if (start_state == ENTER_PASSPHRASE ||
334 start_state == CONFIGURE || 339 start_state == CONFIGURE ||
335 start_state == PASSPHRASE_MIGRATION) { 340 start_state == PASSPHRASE_MIGRATION) {
336 result = DONE; 341 result = DONE;
337 } 342 }
338 DCHECK_NE(FATAL_ERROR, result) << 343 DCHECK_NE(FATAL_ERROR, result) <<
339 "Invalid start state for discrete run: " << start_state; 344 "Invalid start state for discrete run: " << start_state;
340 return result; 345 return result;
341 } 346 }
OLDNEW
« no previous file with comments | « chrome/browser/sync/profile_sync_service_mock.cc ('k') | chrome/browser/sync/sync_ui_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698