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 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1013 web_contents_->GetRenderViewHost()->ClosePage(); | 1013 web_contents_->GetRenderViewHost()->ClosePage(); |
1014 } | 1014 } |
1015 | 1015 |
1016 InfoBarService* DevToolsWindow::GetInfoBarService() { | 1016 InfoBarService* DevToolsWindow::GetInfoBarService() { |
1017 return is_docked_ ? | 1017 return is_docked_ ? |
1018 InfoBarService::FromWebContents(GetInspectedWebContents()) : | 1018 InfoBarService::FromWebContents(GetInspectedWebContents()) : |
1019 InfoBarService::FromWebContents(web_contents_); | 1019 InfoBarService::FromWebContents(web_contents_); |
1020 } | 1020 } |
1021 | 1021 |
1022 void DevToolsWindow::RenderProcessGone() { | 1022 void DevToolsWindow::RenderProcessGone() { |
1023 // Do this first so that when GetDockedInstanceForInspectedTab is called | |
1024 // from CloseContents it won't return this instance | |
1025 // see crbug.com/372504 | |
1026 content::DevToolsManager::GetInstance()->ClientHostClosing( | |
1027 bindings_->frontend_host()); | |
1023 // Docked DevToolsWindow owns its web_contents_ and must delete it. | 1028 // Docked DevToolsWindow owns its web_contents_ and must delete it. |
1024 // Undocked web_contents_ are owned and handled by browser. | 1029 // Undocked web_contents_ are owned and handled by browser. |
1030 // see crbug.com/369932 | |
1025 if (is_docked_) | 1031 if (is_docked_) |
1026 CloseContents(web_contents_); | 1032 CloseContents(web_contents_); |
pfeldman
2014/05/15 14:23:51
Lets put it into CloseContents.
| |
1027 } | 1033 } |
1028 | 1034 |
1029 void DevToolsWindow::OnLoadCompleted() { | 1035 void DevToolsWindow::OnLoadCompleted() { |
1030 // First seed inspected tab id for extension APIs. | 1036 // First seed inspected tab id for extension APIs. |
1031 WebContents* inspected_web_contents = GetInspectedWebContents(); | 1037 WebContents* inspected_web_contents = GetInspectedWebContents(); |
1032 if (inspected_web_contents) { | 1038 if (inspected_web_contents) { |
1033 SessionTabHelper* session_tab_helper = | 1039 SessionTabHelper* session_tab_helper = |
1034 SessionTabHelper::FromWebContents(inspected_web_contents); | 1040 SessionTabHelper::FromWebContents(inspected_web_contents); |
1035 if (session_tab_helper) { | 1041 if (session_tab_helper) { |
1036 base::FundamentalValue tabId(session_tab_helper->session_id().id()); | 1042 base::FundamentalValue tabId(session_tab_helper->session_id().id()); |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1161 closure.Run(); | 1167 closure.Run(); |
1162 return; | 1168 return; |
1163 } | 1169 } |
1164 load_completed_callback_ = closure; | 1170 load_completed_callback_ = closure; |
1165 } | 1171 } |
1166 | 1172 |
1167 bool DevToolsWindow::ForwardKeyboardEvent( | 1173 bool DevToolsWindow::ForwardKeyboardEvent( |
1168 const content::NativeWebKeyboardEvent& event) { | 1174 const content::NativeWebKeyboardEvent& event) { |
1169 return event_forwarder_->ForwardEvent(event); | 1175 return event_forwarder_->ForwardEvent(event); |
1170 } | 1176 } |
OLD | NEW |