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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 | 1008 |
1009 void DevToolsWindow::SetInspectedPageBounds(const gfx::Rect& rect) { | 1009 void DevToolsWindow::SetInspectedPageBounds(const gfx::Rect& rect) { |
1010 DevToolsContentsResizingStrategy strategy(rect); | 1010 DevToolsContentsResizingStrategy strategy(rect); |
1011 if (contents_resizing_strategy_.Equals(strategy)) | 1011 if (contents_resizing_strategy_.Equals(strategy)) |
1012 return; | 1012 return; |
1013 | 1013 |
1014 contents_resizing_strategy_.CopyFrom(strategy); | 1014 contents_resizing_strategy_.CopyFrom(strategy); |
1015 UpdateBrowserWindow(); | 1015 UpdateBrowserWindow(); |
1016 } | 1016 } |
1017 | 1017 |
1018 void DevToolsWindow::SetContentsResizingStrategy( | |
1019 const gfx::Insets& insets, const gfx::Size& min_size) { | |
1020 DevToolsContentsResizingStrategy strategy(insets, min_size); | |
1021 if (contents_resizing_strategy_.Equals(strategy)) | |
1022 return; | |
1023 | |
1024 contents_resizing_strategy_.CopyFrom(strategy); | |
1025 UpdateBrowserWindow(); | |
1026 } | |
1027 | |
1028 void DevToolsWindow::InspectElementCompleted() { | 1018 void DevToolsWindow::InspectElementCompleted() { |
1029 if (!inspect_element_start_time_.is_null()) { | 1019 if (!inspect_element_start_time_.is_null()) { |
1030 UMA_HISTOGRAM_TIMES("DevTools.InspectElement", | 1020 UMA_HISTOGRAM_TIMES("DevTools.InspectElement", |
1031 base::TimeTicks::Now() - inspect_element_start_time_); | 1021 base::TimeTicks::Now() - inspect_element_start_time_); |
1032 inspect_element_start_time_ = base::TimeTicks(); | 1022 inspect_element_start_time_ = base::TimeTicks(); |
1033 } | 1023 } |
1034 } | 1024 } |
1035 | 1025 |
1036 void DevToolsWindow::MoveWindow(int x, int y) { | 1026 void DevToolsWindow::MoveWindow(int x, int y) { |
1037 if (!is_docked_) { | 1027 if (!is_docked_) { |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1258 closure.Run(); | 1248 closure.Run(); |
1259 return; | 1249 return; |
1260 } | 1250 } |
1261 load_completed_callback_ = closure; | 1251 load_completed_callback_ = closure; |
1262 } | 1252 } |
1263 | 1253 |
1264 bool DevToolsWindow::ForwardKeyboardEvent( | 1254 bool DevToolsWindow::ForwardKeyboardEvent( |
1265 const content::NativeWebKeyboardEvent& event) { | 1255 const content::NativeWebKeyboardEvent& event) { |
1266 return event_forwarder_->ForwardEvent(event); | 1256 return event_forwarder_->ForwardEvent(event); |
1267 } | 1257 } |
OLD | NEW |