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

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: Fixed more comments Created 6 years, 10 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
« no previous file with comments | « chrome/browser/devtools/devtools_window.h ('k') | chrome/browser/ui/cocoa/dev_tools_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/devtools/devtools_window.cc
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc
index b00c30609fdc4745e4b8e7df8158acec36f07e20..6e981381e181d472d1c193f62aa6a0b95ccc2746 100644
--- a/chrome/browser/devtools/devtools_window.cc
+++ b/chrome/browser/devtools/devtools_window.cc
@@ -492,8 +492,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 {
@@ -997,14 +998,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_.Equals(strategy))
return;
- }
- contents_insets_ = gfx::Insets(top, left, bottom, right);
+ contents_resizing_strategy_.CopyFrom(strategy);
if (is_docked_) {
// Update inspected window.
BrowserWindow* inspected_window = GetInspectedBrowserWindow();
« no previous file with comments | « chrome/browser/devtools/devtools_window.h ('k') | chrome/browser/ui/cocoa/dev_tools_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698