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

Side by Side Diff: chrome/browser/devtools/devtools_window.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/devtools/devtools_window.h" 5 #include "chrome/browser/devtools/devtools_window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after
813 inspected_web_contents->OpenURL(params) : NULL; 813 inspected_web_contents->OpenURL(params) : NULL;
814 } 814 }
815 815
816 bindings_->Reattach(); 816 bindings_->Reattach();
817 817
818 content::NavigationController::LoadURLParams load_url_params(params.url); 818 content::NavigationController::LoadURLParams load_url_params(params.url);
819 main_web_contents_->GetController().LoadURLWithParams(load_url_params); 819 main_web_contents_->GetController().LoadURLWithParams(load_url_params);
820 return main_web_contents_; 820 return main_web_contents_;
821 } 821 }
822 822
823 void DevToolsWindow::ActivateContents(WebContents* contents) { 823 void DevToolsWindow::ActivateContents(WebContents* contents,
824 bool user_gesture) {
824 if (is_docked_) { 825 if (is_docked_) {
825 WebContents* inspected_tab = GetInspectedWebContents(); 826 WebContents* inspected_tab = GetInspectedWebContents();
826 if (inspected_tab) 827 if (inspected_tab)
827 inspected_tab->GetDelegate()->ActivateContents(inspected_tab); 828 inspected_tab->GetDelegate()->ActivateContents(inspected_tab,
829 true /* user_gesture */);
828 } else if (browser_) { 830 } else if (browser_) {
829 browser_->window()->Activate(); 831 browser_->window()->Activate();
830 } 832 }
831 } 833 }
832 834
833 void DevToolsWindow::AddNewContents(WebContents* source, 835 void DevToolsWindow::AddNewContents(WebContents* source,
834 WebContents* new_contents, 836 WebContents* new_contents,
835 WindowOpenDisposition disposition, 837 WindowOpenDisposition disposition,
836 const gfx::Rect& initial_rect, 838 const gfx::Rect& initial_rect,
837 bool user_gesture, 839 bool user_gesture,
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 closure.Run(); 1205 closure.Run();
1204 return; 1206 return;
1205 } 1207 }
1206 load_completed_callback_ = closure; 1208 load_completed_callback_ = closure;
1207 } 1209 }
1208 1210
1209 bool DevToolsWindow::ForwardKeyboardEvent( 1211 bool DevToolsWindow::ForwardKeyboardEvent(
1210 const content::NativeWebKeyboardEvent& event) { 1212 const content::NativeWebKeyboardEvent& event) {
1211 return event_forwarder_->ForwardEvent(event); 1213 return event_forwarder_->ForwardEvent(event);
1212 } 1214 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_window.h ('k') | chrome/browser/media/media_stream_capture_indicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698