| 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/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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 FilePath profile_file_path = profile->GetPath(); | 515 FilePath profile_file_path = profile->GetPath(); |
| 516 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); | 516 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); |
| 517 } | 517 } |
| 518 } | 518 } |
| 519 | 519 |
| 520 void SyncSetupHandler::SetFlow(SyncSetupFlow* flow) { | 520 void SyncSetupHandler::SetFlow(SyncSetupFlow* flow) { |
| 521 flow_ = flow; | 521 flow_ = flow; |
| 522 } | 522 } |
| 523 | 523 |
| 524 void SyncSetupHandler::Focus() { | 524 void SyncSetupHandler::Focus() { |
| 525 web_ui()->GetWebContents()->GetRenderViewHost()->delegate()->Activate(); | 525 web_ui()->GetWebContents()->GetRenderViewHost()->GetDelegate()->Activate(); |
| 526 } | 526 } |
| 527 | 527 |
| 528 void SyncSetupHandler::OnDidClosePage(const ListValue* args) { | 528 void SyncSetupHandler::OnDidClosePage(const ListValue* args) { |
| 529 CloseSyncSetup(); | 529 CloseSyncSetup(); |
| 530 } | 530 } |
| 531 | 531 |
| 532 void SyncSetupHandler::HandleSubmitAuth(const ListValue* args) { | 532 void SyncSetupHandler::HandleSubmitAuth(const ListValue* args) { |
| 533 std::string json; | 533 std::string json; |
| 534 if (!args->GetString(0, &json)) { | 534 if (!args->GetString(0, &json)) { |
| 535 NOTREACHED() << "Could not read JSON argument"; | 535 NOTREACHED() << "Could not read JSON argument"; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 if (i != current_profile_index && AreUserNamesEqual( | 784 if (i != current_profile_index && AreUserNamesEqual( |
| 785 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { | 785 cache.GetUserNameOfProfileAtIndex(i), username_utf16)) { |
| 786 *error_message = l10n_util::GetStringUTF16( | 786 *error_message = l10n_util::GetStringUTF16( |
| 787 IDS_SYNC_USER_NAME_IN_USE_ERROR); | 787 IDS_SYNC_USER_NAME_IN_USE_ERROR); |
| 788 return false; | 788 return false; |
| 789 } | 789 } |
| 790 } | 790 } |
| 791 | 791 |
| 792 return true; | 792 return true; |
| 793 } | 793 } |
| OLD | NEW |