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 <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 14 matching lines...) Expand all Loading... |
25 #include "chrome/browser/profiles/profile_info_cache.h" | 25 #include "chrome/browser/profiles/profile_info_cache.h" |
26 #include "chrome/browser/profiles/profile_metrics.h" | 26 #include "chrome/browser/profiles/profile_metrics.h" |
27 #include "chrome/browser/signin/chrome_signin_helper.h" | 27 #include "chrome/browser/signin/chrome_signin_helper.h" |
28 #include "chrome/browser/signin/signin_error_controller_factory.h" | 28 #include "chrome/browser/signin/signin_error_controller_factory.h" |
29 #include "chrome/browser/signin/signin_manager_factory.h" | 29 #include "chrome/browser/signin/signin_manager_factory.h" |
30 #include "chrome/browser/signin/signin_promo.h" | 30 #include "chrome/browser/signin/signin_promo.h" |
31 #include "chrome/browser/sync/profile_sync_service_factory.h" | 31 #include "chrome/browser/sync/profile_sync_service_factory.h" |
32 #include "chrome/browser/ui/browser_finder.h" | 32 #include "chrome/browser/ui/browser_finder.h" |
33 #include "chrome/browser/ui/browser_window.h" | 33 #include "chrome/browser/ui/browser_window.h" |
34 #include "chrome/browser/ui/singleton_tabs.h" | 34 #include "chrome/browser/ui/singleton_tabs.h" |
35 #include "chrome/browser/ui/webui/options/options_handlers_helper.h" | 35 #include "chrome/browser/ui/webui/profile_helper.h" |
36 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 36 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
37 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 37 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
38 #include "chrome/common/chrome_switches.h" | 38 #include "chrome/common/chrome_switches.h" |
39 #include "chrome/common/url_constants.h" | 39 #include "chrome/common/url_constants.h" |
40 #include "chrome/grit/chromium_strings.h" | 40 #include "chrome/grit/chromium_strings.h" |
41 #include "chrome/grit/generated_resources.h" | 41 #include "chrome/grit/generated_resources.h" |
42 #include "chrome/grit/locale_settings.h" | 42 #include "chrome/grit/locale_settings.h" |
43 #include "components/autofill/core/common/autofill_constants.h" | 43 #include "components/autofill/core/common/autofill_constants.h" |
44 #include "components/autofill/core/common/autofill_pref_names.h" | 44 #include "components/autofill/core/common/autofill_pref_names.h" |
45 #include "components/browser_sync/browser/profile_sync_service.h" | 45 #include "components/browser_sync/browser/profile_sync_service.h" |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
679 bool delete_profile = false; | 679 bool delete_profile = false; |
680 args->GetBoolean(0, &delete_profile); | 680 args->GetBoolean(0, &delete_profile); |
681 signin_metrics::SignoutDelete delete_metric = | 681 signin_metrics::SignoutDelete delete_metric = |
682 delete_profile ? signin_metrics::SignoutDelete::DELETED | 682 delete_profile ? signin_metrics::SignoutDelete::DELETED |
683 : signin_metrics::SignoutDelete::KEEPING; | 683 : signin_metrics::SignoutDelete::KEEPING; |
684 SigninManagerFactory::GetForProfile(GetProfile()) | 684 SigninManagerFactory::GetForProfile(GetProfile()) |
685 ->SignOut(signin_metrics::USER_CLICKED_SIGNOUT_SETTINGS, delete_metric); | 685 ->SignOut(signin_metrics::USER_CLICKED_SIGNOUT_SETTINGS, delete_metric); |
686 | 686 |
687 if (delete_profile) { | 687 if (delete_profile) { |
688 // Do as BrowserOptionsHandler::DeleteProfile(). | 688 // Do as BrowserOptionsHandler::DeleteProfile(). |
689 options::helper::DeleteProfileAtPath(GetProfile()->GetPath(), web_ui()); | 689 profiles::helper::DeleteProfileAtPath(GetProfile()->GetPath(), web_ui()); |
690 } | 690 } |
691 } | 691 } |
692 #endif | 692 #endif |
693 | 693 |
694 void SyncSetupHandler::HandleCloseTimeout(const base::ListValue* args) { | 694 void SyncSetupHandler::HandleCloseTimeout(const base::ListValue* args) { |
695 CloseSyncSetup(); | 695 CloseSyncSetup(); |
696 } | 696 } |
697 | 697 |
698 void SyncSetupHandler::CloseSyncSetup() { | 698 void SyncSetupHandler::CloseSyncSetup() { |
699 // Stop a timer to handle timeout in waiting for checking network connection. | 699 // Stop a timer to handle timeout in waiting for checking network connection. |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 "SyncSetupOverlay.showSyncSetupPage", page, args); | 958 "SyncSetupOverlay.showSyncSetupPage", page, args); |
959 | 959 |
960 // Make sure the tab used for the Gaia sign in does not cover the settings | 960 // Make sure the tab used for the Gaia sign in does not cover the settings |
961 // tab. | 961 // tab. |
962 FocusUI(); | 962 FocusUI(); |
963 } | 963 } |
964 | 964 |
965 LoginUIService* SyncSetupHandler::GetLoginUIService() const { | 965 LoginUIService* SyncSetupHandler::GetLoginUIService() const { |
966 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 966 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
967 } | 967 } |
OLD | NEW |