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

Unified Diff: ui/aura/window.h

Issue 8273040: Minimum size for aura window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comment, add tests Created 9 years, 2 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: ui/aura/window.h
diff --git a/ui/aura/window.h b/ui/aura/window.h
index 4a71023722782a01350fee7f4740f4e65e124523..b0ad04bf7b54f0ac22462633a42af0e273fc50e7 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -121,6 +121,13 @@ class AURA_EXPORT Window : public ui::LayerDelegate {
// Changes the bounds of the window.
void SetBounds(const gfx::Rect& new_bounds);
+ // Sets the minimum size of the window that a user can resize it to.
+ // A smaller size can still be set using SetBounds().
+ void set_minimum_size(const gfx::Size& minimum_size) {
+ minimum_size_ = minimum_size;
+ }
+ const gfx::Size& minimum_size() const { return minimum_size_; }
+
// Marks the a portion of window as needing to be painted.
void SchedulePaintInRect(const gfx::Rect& rect);
@@ -239,6 +246,9 @@ class AURA_EXPORT Window : public ui::LayerDelegate {
virtual internal::RootWindow* GetRoot();
private:
+ // Changes the bounds of the window without condition.
+ void SetBoundsInternal(const gfx::Rect& new_bounds);
+
// Updates the visible state of the layer, but does not make visible-state
// specific changes. Called from Show()/Hide().
void SetVisible(bool visible);
@@ -276,6 +286,9 @@ class AURA_EXPORT Window : public ui::LayerDelegate {
// The original bounds of a maximized/fullscreen window.
gfx::Rect restore_bounds_;
+ // The minimum size of the window a user can resize to.
+ gfx::Size minimum_size_;
+
scoped_ptr<ui::Layer> layer_;
// The Window's parent.

Powered by Google App Engine
This is Rietveld 408576698