Chromium Code Reviews| Index: apps/shell_window.h |
| diff --git a/apps/shell_window.h b/apps/shell_window.h |
| index 3d42da76a162d54ba1d49bb8fe63edaf5b1bcef0..b79140f0376e95e7430f273be56befa2b9402cdc 100644 |
| --- a/apps/shell_window.h |
| +++ b/apps/shell_window.h |
| @@ -90,6 +90,37 @@ class ShellWindow : public content::NotificationObserver, |
| FRAME_NONE, // Frameless window. |
| }; |
| + class SizeConstraints { |
| + public: |
| + // The value SizeConstraints uses to represent an unbounded width or height. |
| + static const int kUnboundedSize = 0; |
| + |
| + SizeConstraints(); |
| + SizeConstraints(const gfx::Size& min_size, const gfx::Size& max_size); |
| + ~SizeConstraints(); |
| + |
| + // Returns the bounds with its size clamped to the min/max size. |
| + gfx::Size ClampSize(gfx::Size size) const; |
| + |
| + // When gfx::Size is used as a min/max size, a zero represents an unbounded |
| + // component. This method checks whether either component is specified. |
| + // Note we can't use gfx::Size::IsEmpty as it returns true if either width |
| + // or height is zero. |
| + bool HasMinimumSize() const; |
| + bool HasMaximumSize() const; |
| + |
| + // This returns true if all components are specified, and min and max are |
| + // equal. |
| + bool HasFixedSize() const; |
| + |
| + gfx::Size GetMaximumSize() const; |
| + gfx::Size GetMinimumSize() const; |
| + |
| + private: |
| + gfx::Size minimum_size_; |
| + gfx::Size maximum_size_; |
| + }; |
| + |
| struct CreateParams { |
| CreateParams(); |
| ~CreateParams(); |
| @@ -323,6 +354,11 @@ class ShellWindow : public content::NotificationObserver, |
| const gfx::Size& minimum_size, |
| gfx::Rect* bounds) const; |
| + // Loads the appropriate default or cached window bounds and constraints them |
|
tapted
2013/10/15 03:33:04
nit: constraints -> constrains (or clamps)
jackhou1
2013/10/15 05:07:13
Done.
|
| + // based on screen size and minimum/maximum size. Returns a new CreateParams |
| + // that should be used to create the window. |
| + CreateParams LoadDefaultsAndConstrain(CreateParams params) const; |
| + |
| // Load the app's image, firing a load state change when loaded. |
| void UpdateExtensionAppIcon(); |