| 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 "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 763 void SyncSetupHandler::OpenConfigureSync() { | 763 void SyncSetupHandler::OpenConfigureSync() { |
| 764 if (!PrepareSyncSetup()) | 764 if (!PrepareSyncSetup()) |
| 765 return; | 765 return; |
| 766 | 766 |
| 767 DisplayConfigureSync(false); | 767 DisplayConfigureSync(false); |
| 768 } | 768 } |
| 769 | 769 |
| 770 void SyncSetupHandler::FocusUI() { | 770 void SyncSetupHandler::FocusUI() { |
| 771 DCHECK(IsActiveLogin()); | 771 DCHECK(IsActiveLogin()); |
| 772 WebContents* web_contents = web_ui()->GetWebContents(); | 772 WebContents* web_contents = web_ui()->GetWebContents(); |
| 773 web_contents->GetDelegate()->ActivateContents(web_contents); | 773 // TODO(johnme): Can we sometimes be certain this was for a user gesture? |
| 774 web_contents->GetDelegate()->ActivateContents(web_contents, |
| 775 false /* user_gesture */); |
| 774 } | 776 } |
| 775 | 777 |
| 776 void SyncSetupHandler::CloseUI() { | 778 void SyncSetupHandler::CloseUI() { |
| 777 CloseSyncSetup(); | 779 CloseSyncSetup(); |
| 778 base::StringValue page("done"); | 780 base::StringValue page("done"); |
| 779 web_ui()->CallJavascriptFunction( | 781 web_ui()->CallJavascriptFunction( |
| 780 "SyncSetupOverlay.showSyncSetupPage", page); | 782 "SyncSetupOverlay.showSyncSetupPage", page); |
| 781 } | 783 } |
| 782 | 784 |
| 783 bool SyncSetupHandler::IsExistingWizardPresent() { | 785 bool SyncSetupHandler::IsExistingWizardPresent() { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 918 "SyncSetupOverlay.showSyncSetupPage", page, args); | 920 "SyncSetupOverlay.showSyncSetupPage", page, args); |
| 919 | 921 |
| 920 // Make sure the tab used for the Gaia sign in does not cover the settings | 922 // Make sure the tab used for the Gaia sign in does not cover the settings |
| 921 // tab. | 923 // tab. |
| 922 FocusUI(); | 924 FocusUI(); |
| 923 } | 925 } |
| 924 | 926 |
| 925 LoginUIService* SyncSetupHandler::GetLoginUIService() const { | 927 LoginUIService* SyncSetupHandler::GetLoginUIService() const { |
| 926 return LoginUIServiceFactory::GetForProfile(GetProfile()); | 928 return LoginUIServiceFactory::GetForProfile(GetProfile()); |
| 927 } | 929 } |
| OLD | NEW |