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

Side by Side Diff: chrome/browser/devtools/devtools_window.cc

Issue 1057553004: [DevTools] Fix crash in DevToolsWindow::ActivateContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 bindings_->Reattach(); 833 bindings_->Reattach();
834 834
835 content::NavigationController::LoadURLParams load_url_params(params.url); 835 content::NavigationController::LoadURLParams load_url_params(params.url);
836 main_web_contents_->GetController().LoadURLWithParams(load_url_params); 836 main_web_contents_->GetController().LoadURLWithParams(load_url_params);
837 return main_web_contents_; 837 return main_web_contents_;
838 } 838 }
839 839
840 void DevToolsWindow::ActivateContents(WebContents* contents) { 840 void DevToolsWindow::ActivateContents(WebContents* contents) {
841 if (is_docked_) { 841 if (is_docked_) {
842 WebContents* inspected_tab = GetInspectedWebContents(); 842 WebContents* inspected_tab = GetInspectedWebContents();
843 inspected_tab->GetDelegate()->ActivateContents(inspected_tab); 843 if (inspected_tab)
844 inspected_tab->GetDelegate()->ActivateContents(inspected_tab);
844 } else if (browser_) { 845 } else if (browser_) {
845 browser_->window()->Activate(); 846 browser_->window()->Activate();
846 } 847 }
847 } 848 }
848 849
849 void DevToolsWindow::AddNewContents(WebContents* source, 850 void DevToolsWindow::AddNewContents(WebContents* source,
850 WebContents* new_contents, 851 WebContents* new_contents,
851 WindowOpenDisposition disposition, 852 WindowOpenDisposition disposition,
852 const gfx::Rect& initial_rect, 853 const gfx::Rect& initial_rect,
853 bool user_gesture, 854 bool user_gesture,
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
1219 closure.Run(); 1220 closure.Run();
1220 return; 1221 return;
1221 } 1222 }
1222 load_completed_callback_ = closure; 1223 load_completed_callback_ = closure;
1223 } 1224 }
1224 1225
1225 bool DevToolsWindow::ForwardKeyboardEvent( 1226 bool DevToolsWindow::ForwardKeyboardEvent(
1226 const content::NativeWebKeyboardEvent& event) { 1227 const content::NativeWebKeyboardEvent& event) {
1227 return event_forwarder_->ForwardEvent(event); 1228 return event_forwarder_->ForwardEvent(event);
1228 } 1229 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698