Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(300)

Side by Side Diff: chrome/browser/ui/webui/options/sync_setup_handler.cc

Issue 1153813003: Add user_gesture param to WebContentsDelegate::ActivateContents Base URL: https://chromium.googlesource.com/chromium/src.git@ug1_WebContentsImpl_Activate
Patch Set: Update callers Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698