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

Side by Side Diff: ash/wm/window_state.h

Issue 314433003: ash: Make wm::WindowState's c'tor private. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 6 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
« no previous file with comments | « no previous file | ash/wm/window_state.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 ASH_WM_WINDOW_STATE_H_ 5 #ifndef ASH_WM_WINDOW_STATE_H_
6 #define ASH_WM_WINDOW_STATE_H_ 6 #define ASH_WM_WINDOW_STATE_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/wm/drag_details.h" 9 #include "ash/wm/drag_details.h"
10 #include "ash/wm/wm_types.h" 10 #include "ash/wm/wm_types.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 // Gets called before the state objects gets deactivated / detached from the 71 // Gets called before the state objects gets deactivated / detached from the
72 // window, so that it can save the various states it is interested in. 72 // window, so that it can save the various states it is interested in.
73 // Note: This only gets called when the state object gets changed. 73 // Note: This only gets called when the state object gets changed.
74 virtual void DetachState(WindowState* window_state) = 0; 74 virtual void DetachState(WindowState* window_state) = 0;
75 75
76 private: 76 private:
77 DISALLOW_COPY_AND_ASSIGN(State); 77 DISALLOW_COPY_AND_ASSIGN(State);
78 }; 78 };
79 79
80 explicit WindowState(aura::Window* window); 80 // Call GetWindowState() to instantiate this class.
81 virtual ~WindowState(); 81 virtual ~WindowState();
82 82
83 aura::Window* window() { return window_; } 83 aura::Window* window() { return window_; }
84 const aura::Window* window() const { return window_; } 84 const aura::Window* window() const { return window_; }
85 85
86 bool HasDelegate() const; 86 bool HasDelegate() const;
87 void SetDelegate(scoped_ptr<WindowStateDelegate> delegate); 87 void SetDelegate(scoped_ptr<WindowStateDelegate> delegate);
88 88
89 // Returns the window's current ash state type. 89 // Returns the window's current ash state type.
90 // Refer to WindowStateType definition in wm_types.h as for why Ash 90 // Refer to WindowStateType definition in wm_types.h as for why Ash
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 DragDetails* drag_details() { return drag_details_.get(); } 297 DragDetails* drag_details() { return drag_details_.get(); }
298 298
299 // aura::WindowObserver overrides: 299 // aura::WindowObserver overrides:
300 virtual void OnWindowPropertyChanged(aura::Window* window, 300 virtual void OnWindowPropertyChanged(aura::Window* window,
301 const void* key, 301 const void* key,
302 intptr_t old) OVERRIDE; 302 intptr_t old) OVERRIDE;
303 303
304 private: 304 private:
305 friend class DefaultState; 305 friend class DefaultState;
306 friend class ash::MaximizeModeWindowState; 306 friend class ash::MaximizeModeWindowState;
307 friend ASH_EXPORT WindowState* GetWindowState(aura::Window*);
307 FRIEND_TEST_ALL_PREFIXES(WindowAnimationsTest, CrossFadeToBounds); 308 FRIEND_TEST_ALL_PREFIXES(WindowAnimationsTest, CrossFadeToBounds);
308 309
310 explicit WindowState(aura::Window* window);
311
309 WindowStateDelegate* delegate() { return delegate_.get(); } 312 WindowStateDelegate* delegate() { return delegate_.get(); }
310 313
311 // Returns the window's current show state. 314 // Returns the window's current show state.
312 ui::WindowShowState GetShowState() const; 315 ui::WindowShowState GetShowState() const;
313 316
314 // Sets the window's bounds in screen coordinates. 317 // Sets the window's bounds in screen coordinates.
315 void SetBoundsInScreen(const gfx::Rect& bounds_in_screen); 318 void SetBoundsInScreen(const gfx::Rect& bounds_in_screen);
316 319
317 // Adjusts the |bounds| so that they are flush with the edge of the 320 // Adjusts the |bounds| so that they are flush with the edge of the
318 // workspace if the window represented by |window_state| is side snapped. 321 // workspace if the window represented by |window_state| is side snapped.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 ASH_EXPORT WindowState* GetWindowState(aura::Window* window); 386 ASH_EXPORT WindowState* GetWindowState(aura::Window* window);
384 387
385 // const version of GetWindowState. 388 // const version of GetWindowState.
386 ASH_EXPORT const WindowState* 389 ASH_EXPORT const WindowState*
387 GetWindowState(const aura::Window* window); 390 GetWindowState(const aura::Window* window);
388 391
389 } // namespace wm 392 } // namespace wm
390 } // namespace ash 393 } // namespace ash
391 394
392 #endif // ASH_WM_WINDOW_STATE_H_ 395 #endif // ASH_WM_WINDOW_STATE_H_
OLDNEW
« no previous file with comments | « no previous file | ash/wm/window_state.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698