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 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 } | 1105 } |
1106 | 1106 |
1107 void DevToolsWindow::OnLoadCompleted() { | 1107 void DevToolsWindow::OnLoadCompleted() { |
1108 // First seed inspected tab id for extension APIs. | 1108 // First seed inspected tab id for extension APIs. |
1109 WebContents* inspected_web_contents = GetInspectedWebContents(); | 1109 WebContents* inspected_web_contents = GetInspectedWebContents(); |
1110 if (inspected_web_contents) { | 1110 if (inspected_web_contents) { |
1111 SessionTabHelper* session_tab_helper = | 1111 SessionTabHelper* session_tab_helper = |
1112 SessionTabHelper::FromWebContents(inspected_web_contents); | 1112 SessionTabHelper::FromWebContents(inspected_web_contents); |
1113 if (session_tab_helper) { | 1113 if (session_tab_helper) { |
1114 base::FundamentalValue tabId(session_tab_helper->session_id().id()); | 1114 base::FundamentalValue tabId(session_tab_helper->session_id().id()); |
1115 // TODO(dgozman): remove |WebInspector.setInspectedTabId| call in M45. | 1115 bindings_->CallClientFunction("InspectorFrontendAPI.setInspectedTabId", |
1116 bindings_->CallClientFunction( | 1116 &tabId, NULL, NULL); |
1117 "(InspectorFrontendAPI.setInspectedTabId ||" | |
1118 "WebInspector.setInspectedTabId)", | |
1119 &tabId, NULL, NULL); | |
1120 } | 1117 } |
1121 } | 1118 } |
1122 | 1119 |
1123 if (life_stage_ == kClosing) | 1120 if (life_stage_ == kClosing) |
1124 return; | 1121 return; |
1125 | 1122 |
1126 // We could be in kLoadCompleted state already if frontend reloads itself. | 1123 // We could be in kLoadCompleted state already if frontend reloads itself. |
1127 if (life_stage_ != kLoadCompleted) { | 1124 if (life_stage_ != kLoadCompleted) { |
1128 // Load is completed when both kIsDockedSet and kOnLoadFired happened. | 1125 // Load is completed when both kIsDockedSet and kOnLoadFired happened. |
1129 // Here we set kOnLoadFired. | 1126 // Here we set kOnLoadFired. |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1234 closure.Run(); | 1231 closure.Run(); |
1235 return; | 1232 return; |
1236 } | 1233 } |
1237 load_completed_callback_ = closure; | 1234 load_completed_callback_ = closure; |
1238 } | 1235 } |
1239 | 1236 |
1240 bool DevToolsWindow::ForwardKeyboardEvent( | 1237 bool DevToolsWindow::ForwardKeyboardEvent( |
1241 const content::NativeWebKeyboardEvent& event) { | 1238 const content::NativeWebKeyboardEvent& event) { |
1242 return event_forwarder_->ForwardEvent(event); | 1239 return event_forwarder_->ForwardEvent(event); |
1243 } | 1240 } |
OLD | NEW |