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 12 matching lines...) Expand all Loading... | |
23 #include "chrome/browser/signin/chrome_signin_helper.h" | 23 #include "chrome/browser/signin/chrome_signin_helper.h" |
24 #include "chrome/browser/signin/signin_error_controller_factory.h" | 24 #include "chrome/browser/signin/signin_error_controller_factory.h" |
25 #include "chrome/browser/signin/signin_manager_factory.h" | 25 #include "chrome/browser/signin/signin_manager_factory.h" |
26 #include "chrome/browser/signin/signin_promo.h" | 26 #include "chrome/browser/signin/signin_promo.h" |
27 #include "chrome/browser/sync/profile_sync_service_factory.h" | 27 #include "chrome/browser/sync/profile_sync_service_factory.h" |
28 #include "chrome/browser/sync/sync_ui_util.h" | 28 #include "chrome/browser/sync/sync_ui_util.h" |
29 #include "chrome/browser/ui/browser_finder.h" | 29 #include "chrome/browser/ui/browser_finder.h" |
30 #include "chrome/browser/ui/browser_window.h" | 30 #include "chrome/browser/ui/browser_window.h" |
31 #include "chrome/browser/ui/singleton_tabs.h" | 31 #include "chrome/browser/ui/singleton_tabs.h" |
32 #include "chrome/browser/ui/user_manager.h" | 32 #include "chrome/browser/ui/user_manager.h" |
33 #include "chrome/browser/ui/webui/metrics_handler.h" | |
33 #include "chrome/browser/ui/webui/profile_helper.h" | 34 #include "chrome/browser/ui/webui/profile_helper.h" |
34 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 35 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
35 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 36 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
36 #include "chrome/common/chrome_switches.h" | 37 #include "chrome/common/chrome_switches.h" |
37 #include "chrome/grit/generated_resources.h" | 38 #include "chrome/grit/generated_resources.h" |
38 #include "components/autofill/core/common/autofill_constants.h" | 39 #include "components/autofill/core/common/autofill_constants.h" |
39 #include "components/autofill/core/common/autofill_pref_names.h" | 40 #include "components/autofill/core/common/autofill_pref_names.h" |
40 #include "components/browser_sync/browser/profile_sync_service.h" | 41 #include "components/browser_sync/browser/profile_sync_service.h" |
41 #include "components/prefs/pref_service.h" | 42 #include "components/prefs/pref_service.h" |
42 #include "components/signin/core/browser/signin_error_controller.h" | 43 #include "components/signin/core/browser/signin_error_controller.h" |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
189 web_ui()->RegisterMessageCallback( | 190 web_ui()->RegisterMessageCallback( |
190 "SyncSetupShowSetupUI", | 191 "SyncSetupShowSetupUI", |
191 base::Bind(&PeopleHandler::HandleShowSetupUI, base::Unretained(this))); | 192 base::Bind(&PeopleHandler::HandleShowSetupUI, base::Unretained(this))); |
192 web_ui()->RegisterMessageCallback( | 193 web_ui()->RegisterMessageCallback( |
193 "SyncSetupGetSyncStatus", | 194 "SyncSetupGetSyncStatus", |
194 base::Bind(&PeopleHandler::HandleGetSyncStatus, base::Unretained(this))); | 195 base::Bind(&PeopleHandler::HandleGetSyncStatus, base::Unretained(this))); |
195 web_ui()->RegisterMessageCallback( | 196 web_ui()->RegisterMessageCallback( |
196 "SyncSetupManageOtherPeople", | 197 "SyncSetupManageOtherPeople", |
197 base::Bind(&PeopleHandler::HandleManageOtherPeople, | 198 base::Bind(&PeopleHandler::HandleManageOtherPeople, |
198 base::Unretained(this))); | 199 base::Unretained(this))); |
200 | |
199 #if defined(OS_CHROMEOS) | 201 #if defined(OS_CHROMEOS) |
200 web_ui()->RegisterMessageCallback( | 202 web_ui()->RegisterMessageCallback( |
201 "SyncSetupDoSignOutOnAuthError", | 203 "SyncSetupDoSignOutOnAuthError", |
202 base::Bind(&PeopleHandler::HandleDoSignOutOnAuthError, | 204 base::Bind(&PeopleHandler::HandleDoSignOutOnAuthError, |
203 base::Unretained(this))); | 205 base::Unretained(this))); |
204 #else | 206 #else |
205 web_ui()->RegisterMessageCallback( | 207 web_ui()->RegisterMessageCallback( |
206 "SyncSetupStopSyncing", | 208 "SyncSetupStopSyncing", |
207 base::Bind(&PeopleHandler::HandleStopSyncing, base::Unretained(this))); | 209 base::Bind(&PeopleHandler::HandleStopSyncing, base::Unretained(this))); |
208 web_ui()->RegisterMessageCallback( | 210 web_ui()->RegisterMessageCallback( |
209 "SyncSetupStartSignIn", | 211 "SyncSetupStartSignIn", |
210 base::Bind(&PeopleHandler::HandleStartSignin, base::Unretained(this))); | 212 base::Bind(&PeopleHandler::HandleStartSignin, base::Unretained(this))); |
211 #endif | 213 #endif |
214 | |
215 web_ui()->AddMessageHandler(new MetricsHandler()); | |
jdufault
2016/09/13 19:36:35
This should probably be added inside of md_setting
sammiequon
2016/09/13 21:34:58
Done.
| |
212 } | 216 } |
213 | 217 |
214 void PeopleHandler::OnJavascriptAllowed() { | 218 void PeopleHandler::OnJavascriptAllowed() { |
215 PrefService* prefs = profile_->GetPrefs(); | 219 PrefService* prefs = profile_->GetPrefs(); |
216 profile_pref_registrar_.Init(prefs); | 220 profile_pref_registrar_.Init(prefs); |
217 profile_pref_registrar_.Add( | 221 profile_pref_registrar_.Add( |
218 prefs::kSigninAllowed, | 222 prefs::kSigninAllowed, |
219 base::Bind(&PeopleHandler::UpdateSyncStatus, base::Unretained(this))); | 223 base::Bind(&PeopleHandler::UpdateSyncStatus, base::Unretained(this))); |
220 | 224 |
221 SigninManagerBase* signin_manager( | 225 SigninManagerBase* signin_manager( |
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
897 base::FilePath profile_file_path = profile_->GetPath(); | 901 base::FilePath profile_file_path = profile_->GetPath(); |
898 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); | 902 ProfileMetrics::LogProfileSyncSignIn(profile_file_path); |
899 | 903 |
900 // We're done configuring, so notify ProfileSyncService that it is OK to | 904 // We're done configuring, so notify ProfileSyncService that it is OK to |
901 // start syncing. | 905 // start syncing. |
902 sync_blocker_.reset(); | 906 sync_blocker_.reset(); |
903 service->SetFirstSetupComplete(); | 907 service->SetFirstSetupComplete(); |
904 } | 908 } |
905 | 909 |
906 } // namespace settings | 910 } // namespace settings |
OLD | NEW |