Index: chrome/browser/devtools/devtools_contents_resizing_strategy.h |
diff --git a/chrome/browser/devtools/devtools_contents_resizing_strategy.h b/chrome/browser/devtools/devtools_contents_resizing_strategy.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3d9089b4894d60c4774cd282c2aa50538ccf92b4 |
--- /dev/null |
+++ b/chrome/browser/devtools/devtools_contents_resizing_strategy.h |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_DEVTOOLS_DEVTOOLS_CONTENTS_RESIZING_STRATEGY_H_ |
+#define CHROME_BROWSER_DEVTOOLS_DEVTOOLS_CONTENTS_RESIZING_STRATEGY_H_ |
+ |
+#include "base/basictypes.h" |
+#include "ui/gfx/insets.h" |
+#include "ui/gfx/rect.h" |
+#include "ui/gfx/size.h" |
+ |
+class DevToolsContentsResizingStrategy { |
+ public: |
+ DevToolsContentsResizingStrategy(); |
+ DevToolsContentsResizingStrategy(gfx::Insets insets, gfx::Size min_size); |
+ |
+ const gfx::Insets& insets() const { return insets_; } |
+ const gfx::Size& min_size() const { return min_size_; } |
+ |
+ void Apply( |
+ const gfx::Size& container_size, |
+ const gfx::Rect& old_devtools_bounds, |
+ const gfx::Rect& old_contents_bounds, |
+ gfx::Rect* new_devtools_bounds, |
+ gfx::Rect* new_contents_bounds); |
+ |
+ private: |
+ // Insets of contents inside DevTools. |
pfeldman
2014/01/31 15:08:28
Blank line above comments.
dgozman
2014/02/01 13:21:35
Done.
|
+ gfx::Insets insets_; |
+ |
+ // Minimum size of contents. |
+ gfx::Size min_size_; |
pfeldman
2014/01/31 15:08:28
DISALLOW_COPY_AND_ASSIGN is missing
dgozman
2014/02/01 13:21:35
This is data-holding class intended to be copied a
|
+}; |
+ |
+inline bool operator==(const DevToolsContentsResizingStrategy& lhs, |
+ const DevToolsContentsResizingStrategy& rhs) { |
+ return lhs.insets() == rhs.insets() && lhs.min_size() == rhs.min_size(); |
+} |
+ |
+#endif // CHROME_BROWSER_DEVTOOLS_DEVTOOLS_CONTENTS_RESIZING_STRATEGY_H_ |