| 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/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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |