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

Side by Side 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 comments. moved&merged 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef UI_AURA_WINDOW_H_ 5 #ifndef UI_AURA_WINDOW_H_
6 #define UI_AURA_WINDOW_H_ 6 #define UI_AURA_WINDOW_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 virtual ToplevelWindowContainer* AsToplevelWindowContainer(); 114 virtual ToplevelWindowContainer* AsToplevelWindowContainer();
115 virtual const ToplevelWindowContainer* AsToplevelWindowContainer() const; 115 virtual const ToplevelWindowContainer* AsToplevelWindowContainer() const;
116 116
117 // Assigns a LayoutManager to size and place child windows. 117 // Assigns a LayoutManager to size and place child windows.
118 // The Window takes ownership of the LayoutManager. 118 // The Window takes ownership of the LayoutManager.
119 void SetLayoutManager(LayoutManager* layout_manager); 119 void SetLayoutManager(LayoutManager* layout_manager);
120 120
121 // Changes the bounds of the window. 121 // Changes the bounds of the window.
122 void SetBounds(const gfx::Rect& new_bounds); 122 void SetBounds(const gfx::Rect& new_bounds);
123 123
124 // Sets the minimum size of the window that a user can resize it to.
125 // A smaller size can still be set using SetBounds().
126 void set_minimum_size(const gfx::Size& minimum_size) {
127 minimum_size_ = minimum_size;
128 }
129 const gfx::Size& minimum_size() const { return minimum_size_; }
130
124 // Marks the a portion of window as needing to be painted. 131 // Marks the a portion of window as needing to be painted.
125 void SchedulePaintInRect(const gfx::Rect& rect); 132 void SchedulePaintInRect(const gfx::Rect& rect);
126 133
127 // Sets the contents of the window. 134 // Sets the contents of the window.
128 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); 135 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin);
129 136
130 // Sets the parent window of the window. If NULL, the window is parented to 137 // Sets the parent window of the window. If NULL, the window is parented to
131 // the desktop's window. 138 // the desktop's window.
132 void SetParent(Window* parent); 139 void SetParent(Window* parent);
133 140
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 239
233 // Returns an animation configured with the default duration. All animations 240 // Returns an animation configured with the default duration. All animations
234 // should use this. Caller owns returned value. 241 // should use this. Caller owns returned value.
235 static ui::Animation* CreateDefaultAnimation(); 242 static ui::Animation* CreateDefaultAnimation();
236 243
237 protected: 244 protected:
238 // Returns the RootWindow or NULL if we don't yet have a RootWindow. 245 // Returns the RootWindow or NULL if we don't yet have a RootWindow.
239 virtual internal::RootWindow* GetRoot(); 246 virtual internal::RootWindow* GetRoot();
240 247
241 private: 248 private:
249 // Changes the bounds of the window without condition.
250 void SetBoundsInternal(const gfx::Rect& new_bounds);
251
242 // Updates the visible state of the layer, but does not make visible-state 252 // Updates the visible state of the layer, but does not make visible-state
243 // specific changes. Called from Show()/Hide(). 253 // specific changes. Called from Show()/Hide().
244 void SetVisible(bool visible); 254 void SetVisible(bool visible);
245 255
246 // Schedules a paint for the Window's entire bounds. 256 // Schedules a paint for the Window's entire bounds.
247 void SchedulePaint(); 257 void SchedulePaint();
248 258
249 // This window is currently stopping event propagation for any windows behind 259 // This window is currently stopping event propagation for any windows behind
250 // it in the z-order. 260 // it in the z-order.
251 bool StopsEventPropagation() const; 261 bool StopsEventPropagation() const;
(...skipping 17 matching lines...) Expand all
269 279
270 int type_; 280 int type_;
271 281
272 WindowDelegate* delegate_; 282 WindowDelegate* delegate_;
273 283
274 ui::WindowShowState show_state_; 284 ui::WindowShowState show_state_;
275 285
276 // The original bounds of a maximized/fullscreen window. 286 // The original bounds of a maximized/fullscreen window.
277 gfx::Rect restore_bounds_; 287 gfx::Rect restore_bounds_;
278 288
289 // The minimum size of the window a user can resize to.
290 gfx::Size minimum_size_;
291
279 scoped_ptr<ui::Layer> layer_; 292 scoped_ptr<ui::Layer> layer_;
280 293
281 // The Window's parent. 294 // The Window's parent.
282 Window* parent_; 295 Window* parent_;
283 296
284 // Child windows. Topmost is last. 297 // Child windows. Topmost is last.
285 Windows children_; 298 Windows children_;
286 299
287 int id_; 300 int id_;
288 std::string name_; 301 std::string name_;
289 302
290 scoped_ptr<EventFilter> event_filter_; 303 scoped_ptr<EventFilter> event_filter_;
291 scoped_ptr<LayoutManager> layout_manager_; 304 scoped_ptr<LayoutManager> layout_manager_;
292 305
293 void* user_data_; 306 void* user_data_;
294 307
295 // When true, events are not sent to windows behind this one in the z-order, 308 // When true, events are not sent to windows behind this one in the z-order,
296 // provided this window has children. See set_stops_event_propagation(). 309 // provided this window has children. See set_stops_event_propagation().
297 bool stops_event_propagation_; 310 bool stops_event_propagation_;
298 311
299 ObserverList<WindowObserver> observers_; 312 ObserverList<WindowObserver> observers_;
300 313
301 DISALLOW_COPY_AND_ASSIGN(Window); 314 DISALLOW_COPY_AND_ASSIGN(Window);
302 }; 315 };
303 316
304 } // namespace aura 317 } // namespace aura
305 318
306 #endif // UI_AURA_WINDOW_H_ 319 #endif // UI_AURA_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698