| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/settings/people_handler.h" | 5 #include "chrome/browser/ui/webui/settings/people_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "components/sync/base/passphrase_type.h" | 49 #include "components/sync/base/passphrase_type.h" |
| 50 #include "components/sync/base/sync_prefs.h" | 50 #include "components/sync/base/sync_prefs.h" |
| 51 #include "content/public/browser/render_view_host.h" | 51 #include "content/public/browser/render_view_host.h" |
| 52 #include "content/public/browser/web_contents.h" | 52 #include "content/public/browser/web_contents.h" |
| 53 #include "content/public/browser/web_contents_delegate.h" | 53 #include "content/public/browser/web_contents_delegate.h" |
| 54 #include "google_apis/gaia/gaia_auth_util.h" | 54 #include "google_apis/gaia/gaia_auth_util.h" |
| 55 #include "google_apis/gaia/gaia_constants.h" | 55 #include "google_apis/gaia/gaia_constants.h" |
| 56 #include "net/base/url_util.h" | 56 #include "net/base/url_util.h" |
| 57 #include "ui/base/l10n/l10n_util.h" | 57 #include "ui/base/l10n/l10n_util.h" |
| 58 #include "ui/base/webui/web_ui_util.h" | 58 #include "ui/base/webui/web_ui_util.h" |
| 59 #include "ui/keyboard/keyboard_util.h" |
| 59 | 60 |
| 60 #if defined(OS_CHROMEOS) | 61 #if defined(OS_CHROMEOS) |
| 61 #include "components/signin/core/browser/signin_manager_base.h" | 62 #include "components/signin/core/browser/signin_manager_base.h" |
| 62 #else | 63 #else |
| 63 #include "components/signin/core/browser/signin_manager.h" | 64 #include "components/signin/core/browser/signin_manager.h" |
| 64 #endif | 65 #endif |
| 65 | 66 |
| 66 using browser_sync::ProfileSyncService; | 67 using browser_sync::ProfileSyncService; |
| 67 using content::WebContents; | 68 using content::WebContents; |
| 68 using l10n_util::GetStringFUTF16; | 69 using l10n_util::GetStringFUTF16; |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 web_ui()->RegisterMessageCallback( | 192 web_ui()->RegisterMessageCallback( |
| 192 "SyncSetupShowSetupUI", | 193 "SyncSetupShowSetupUI", |
| 193 base::Bind(&PeopleHandler::HandleShowSetupUI, base::Unretained(this))); | 194 base::Bind(&PeopleHandler::HandleShowSetupUI, base::Unretained(this))); |
| 194 web_ui()->RegisterMessageCallback( | 195 web_ui()->RegisterMessageCallback( |
| 195 "SyncSetupGetSyncStatus", | 196 "SyncSetupGetSyncStatus", |
| 196 base::Bind(&PeopleHandler::HandleGetSyncStatus, base::Unretained(this))); | 197 base::Bind(&PeopleHandler::HandleGetSyncStatus, base::Unretained(this))); |
| 197 web_ui()->RegisterMessageCallback( | 198 web_ui()->RegisterMessageCallback( |
| 198 "SyncSetupManageOtherPeople", | 199 "SyncSetupManageOtherPeople", |
| 199 base::Bind(&PeopleHandler::HandleManageOtherPeople, | 200 base::Bind(&PeopleHandler::HandleManageOtherPeople, |
| 200 base::Unretained(this))); | 201 base::Unretained(this))); |
| 202 web_ui()->RegisterMessageCallback( |
| 203 "EnableVirtualKeyboardOverride", |
| 204 base::Bind(&PeopleHandler::HandleEnableVirtualKeyboardOverride, |
| 205 base::Unretained(this))); |
| 201 #if defined(OS_CHROMEOS) | 206 #if defined(OS_CHROMEOS) |
| 202 web_ui()->RegisterMessageCallback( | 207 web_ui()->RegisterMessageCallback( |
| 203 "SyncSetupDoSignOutOnAuthError", | 208 "SyncSetupDoSignOutOnAuthError", |
| 204 base::Bind(&PeopleHandler::HandleDoSignOutOnAuthError, | 209 base::Bind(&PeopleHandler::HandleDoSignOutOnAuthError, |
| 205 base::Unretained(this))); | 210 base::Unretained(this))); |
| 206 #else | 211 #else |
| 207 web_ui()->RegisterMessageCallback( | 212 web_ui()->RegisterMessageCallback( |
| 208 "SyncSetupStopSyncing", | 213 "SyncSetupStopSyncing", |
| 209 base::Bind(&PeopleHandler::HandleStopSyncing, base::Unretained(this))); | 214 base::Bind(&PeopleHandler::HandleStopSyncing, base::Unretained(this))); |
| 210 web_ui()->RegisterMessageCallback( | 215 web_ui()->RegisterMessageCallback( |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 CHECK(args->Get(0, &callback_id)); | 551 CHECK(args->Get(0, &callback_id)); |
| 547 | 552 |
| 548 ResolveJavascriptCallback(*callback_id, *GetSyncStatusDictionary()); | 553 ResolveJavascriptCallback(*callback_id, *GetSyncStatusDictionary()); |
| 549 } | 554 } |
| 550 | 555 |
| 551 void PeopleHandler::HandleManageOtherPeople(const base::ListValue* /* args */) { | 556 void PeopleHandler::HandleManageOtherPeople(const base::ListValue* /* args */) { |
| 552 UserManager::Show(base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL, | 557 UserManager::Show(base::FilePath(), profiles::USER_MANAGER_NO_TUTORIAL, |
| 553 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); | 558 profiles::USER_MANAGER_SELECT_PROFILE_NO_ACTION); |
| 554 } | 559 } |
| 555 | 560 |
| 561 void PeopleHandler::HandleEnableVirtualKeyboardOverride( |
| 562 const base::ListValue* args) { |
| 563 bool hide_keyboard = false; |
| 564 args->GetBoolean(0, &hide_keyboard); |
| 565 keyboard::SetWebUiOverrideEnabled(hide_keyboard); |
| 566 } |
| 567 |
| 556 void PeopleHandler::CloseSyncSetup() { | 568 void PeopleHandler::CloseSyncSetup() { |
| 557 // Stop a timer to handle timeout in waiting for checking network connection. | 569 // Stop a timer to handle timeout in waiting for checking network connection. |
| 558 backend_start_timer_.reset(); | 570 backend_start_timer_.reset(); |
| 559 | 571 |
| 560 // Clear the sync startup tracker, since the setup wizard is being closed. | 572 // Clear the sync startup tracker, since the setup wizard is being closed. |
| 561 sync_startup_tracker_.reset(); | 573 sync_startup_tracker_.reset(); |
| 562 | 574 |
| 563 ProfileSyncService* sync_service = GetSyncService(); | 575 ProfileSyncService* sync_service = GetSyncService(); |
| 564 | 576 |
| 565 // LoginUIService can be nullptr if page is brought up in incognito mode | 577 // LoginUIService can be nullptr if page is brought up in incognito mode |
| (...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 base::FilePath profile_file_path = profile_->GetPath(); | 913 base::FilePath profile_file_path = profile_->GetPath(); |
| 902 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); | 914 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); |
| 903 | 915 |
| 904 // We're done configuring, so notify ProfileSyncService that it is OK to | 916 // We're done configuring, so notify ProfileSyncService that it is OK to |
| 905 // start syncing. | 917 // start syncing. |
| 906 sync_blocker_.reset(); | 918 sync_blocker_.reset(); |
| 907 service->SetFirstSetupComplete(); | 919 service->SetFirstSetupComplete(); |
| 908 } | 920 } |
| 909 | 921 |
| 910 } // namespace settings | 922 } // namespace settings |
| OLD | NEW |