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

Side by Side Diff: chrome/browser/ui/webui/options/sync_setup_handler.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller 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
« no previous file with comments | « chrome/browser/ui/webui/options/sync_setup_handler.h ('k') | chrome/browser/upgrade_detector.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ui/webui/options/sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/options/sync_setup_handler.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 return true; 411 return true;
412 } 412 }
413 413
414 void SyncSetupHandler::DisplaySpinner() { 414 void SyncSetupHandler::DisplaySpinner() {
415 configuring_sync_ = true; 415 configuring_sync_ = true;
416 base::StringValue page("spinner"); 416 base::StringValue page("spinner");
417 base::DictionaryValue args; 417 base::DictionaryValue args;
418 418
419 const int kTimeoutSec = 30; 419 const int kTimeoutSec = 30;
420 DCHECK(!backend_start_timer_); 420 DCHECK(!backend_start_timer_);
421 backend_start_timer_.reset(new base::OneShotTimer<SyncSetupHandler>()); 421 backend_start_timer_.reset(new base::OneShotTimer());
422 backend_start_timer_->Start(FROM_HERE, 422 backend_start_timer_->Start(FROM_HERE,
423 base::TimeDelta::FromSeconds(kTimeoutSec), 423 base::TimeDelta::FromSeconds(kTimeoutSec),
424 this, &SyncSetupHandler::DisplayTimeout); 424 this, &SyncSetupHandler::DisplayTimeout);
425 425
426 web_ui()->CallJavascriptFunction( 426 web_ui()->CallJavascriptFunction(
427 "SyncSetupOverlay.showSyncSetupPage", page, args); 427 "SyncSetupOverlay.showSyncSetupPage", page, args);
428 } 428 }
429 429
430 // TODO(kochi): Handle error conditions other than timeout. 430 // TODO(kochi): Handle error conditions other than timeout.
431 // http://crbug.com/128692 431 // http://crbug.com/128692
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after
920 "SyncSetupOverlay.showSyncSetupPage", page, args); 920 "SyncSetupOverlay.showSyncSetupPage", page, args);
921 921
922 // Make sure the tab used for the Gaia sign in does not cover the settings 922 // Make sure the tab used for the Gaia sign in does not cover the settings
923 // tab. 923 // tab.
924 FocusUI(); 924 FocusUI();
925 } 925 }
926 926
927 LoginUIService* SyncSetupHandler::GetLoginUIService() const { 927 LoginUIService* SyncSetupHandler::GetLoginUIService() const {
928 return LoginUIServiceFactory::GetForProfile(GetProfile()); 928 return LoginUIServiceFactory::GetForProfile(GetProfile());
929 } 929 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/sync_setup_handler.h ('k') | chrome/browser/upgrade_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698