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

Unified Diff: chrome/browser/devtools/devtools_window.cc

Issue 137483007: [DevTools] Use special resizing strategy instead of insets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/devtools/devtools_window.cc
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc
index bcaa20fe4d9159233d204cc44915861c072af119..68146e568d03a1422083b7001a7fd8ee85d37a60 100644
--- a/chrome/browser/devtools/devtools_window.cc
+++ b/chrome/browser/devtools/devtools_window.cc
@@ -498,8 +498,9 @@ content::RenderViewHost* DevToolsWindow::GetRenderViewHost() {
return web_contents_->GetRenderViewHost();
}
-gfx::Insets DevToolsWindow::GetContentsInsets() const {
- return contents_insets_;
+const DevToolsContentsResizingStrategy&
+DevToolsWindow::GetContentsResizingStrategy() const {
+ return contents_resizing_strategy_;
}
gfx::Size DevToolsWindow::GetMinimumSize() const {
@@ -1003,14 +1004,17 @@ void DevToolsWindow::CloseWindow() {
void DevToolsWindow::SetContentsInsets(
int top, int left, int bottom, int right) {
- if (contents_insets_.top() == top &&
- contents_insets_.left() == left &&
- contents_insets_.bottom() == bottom &&
- contents_insets_.right() == right) {
+ gfx::Insets insets(top, left, bottom, right);
+ SetContentsResizingStrategy(insets, contents_resizing_strategy_.min_size());
+}
+
+void DevToolsWindow::SetContentsResizingStrategy(
+ const gfx::Insets& insets, const gfx::Size& min_size) {
+ DevToolsContentsResizingStrategy strategy(insets, min_size);
+ if (contents_resizing_strategy_ == strategy)
return;
- }
- contents_insets_ = gfx::Insets(top, left, bottom, right);
+ contents_resizing_strategy_ = strategy;
if (is_docked_) {
// Update inspected window.
BrowserWindow* inspected_window = GetInspectedBrowserWindow();

Powered by Google App Engine
This is Rietveld 408576698