| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |