| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sync_setup_handler.h" | 5 #include "chrome/browser/ui/webui/sync_setup_handler.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 web_ui_->CallJavascriptFunction( | 475 web_ui_->CallJavascriptFunction( |
| 476 "SyncSetupOverlay.showSyncSetupPage", page, args); | 476 "SyncSetupOverlay.showSyncSetupPage", page, args); |
| 477 } | 477 } |
| 478 | 478 |
| 479 void SyncSetupHandler::ShowSettingUp() { | 479 void SyncSetupHandler::ShowSettingUp() { |
| 480 StringValue page("settingUp"); | 480 StringValue page("settingUp"); |
| 481 web_ui_->CallJavascriptFunction( | 481 web_ui_->CallJavascriptFunction( |
| 482 "SyncSetupOverlay.showSyncSetupPage", page); | 482 "SyncSetupOverlay.showSyncSetupPage", page); |
| 483 } | 483 } |
| 484 | 484 |
| 485 void SyncSetupHandler::ShowSetupDone(const std::wstring& user) { | 485 void SyncSetupHandler::ShowSetupDone(const string16& user) { |
| 486 StringValue page("done"); | 486 StringValue page("done"); |
| 487 web_ui_->CallJavascriptFunction( | 487 web_ui_->CallJavascriptFunction( |
| 488 "SyncSetupOverlay.showSyncSetupPage", page); | 488 "SyncSetupOverlay.showSyncSetupPage", page); |
| 489 | 489 |
| 490 // Suppress the sync promo once the user signs into sync. This way the user | 490 // Suppress the sync promo once the user signs into sync. This way the user |
| 491 // doesn't see the sync promo even if they sign out of sync later on. | 491 // doesn't see the sync promo even if they sign out of sync later on. |
| 492 SyncPromoUI::SetUserSkippedSyncPromo(Profile::FromWebUI(web_ui_)); | 492 SyncPromoUI::SetUserSkippedSyncPromo(Profile::FromWebUI(web_ui_)); |
| 493 | 493 |
| 494 Profile* profile = Profile::FromWebUI(web_ui_); | 494 Profile* profile = Profile::FromWebUI(web_ui_); |
| 495 ProfileSyncService* service = profile->GetProfileSyncService(); | 495 ProfileSyncService* service = profile->GetProfileSyncService(); |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 } | 744 } |
| 745 | 745 |
| 746 void SyncSetupHandler::ShowLoginErrorMessage(const string16& error_message) { | 746 void SyncSetupHandler::ShowLoginErrorMessage(const string16& error_message) { |
| 747 DictionaryValue args; | 747 DictionaryValue args; |
| 748 Profile* profile = Profile::FromWebUI(web_ui_); | 748 Profile* profile = Profile::FromWebUI(web_ui_); |
| 749 ProfileSyncService* service = profile->GetProfileSyncService(); | 749 ProfileSyncService* service = profile->GetProfileSyncService(); |
| 750 SyncSetupFlow::GetArgsForGaiaLogin(service, &args); | 750 SyncSetupFlow::GetArgsForGaiaLogin(service, &args); |
| 751 args.SetString("error_message", error_message); | 751 args.SetString("error_message", error_message); |
| 752 ShowGaiaLogin(args); | 752 ShowGaiaLogin(args); |
| 753 } | 753 } |
| OLD | NEW |