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

Side by Side Diff: ash/wm/property_util.cc

Issue 9035001: Move some more WM functionality down into ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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 | « ash/wm/property_util.h ('k') | ash/wm/root_window_event_filter.h » ('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 (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 #include "ui/aura_shell/property_util.h" 5 #include "ash/wm/property_util.h"
6 6
7 #include "ui/aura/client/aura_constants.h" 7 #include "ui/aura/client/aura_constants.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 #include "ui/base/ui_base_types.h" 9 #include "ui/base/ui_base_types.h"
10 #include "ui/gfx/rect.h" 10 #include "ui/gfx/rect.h"
11 11
12 namespace aura_shell { 12 namespace aura_shell {
13 13
14 void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) { 14 void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) {
15 delete GetRestoreBounds(window); 15 delete GetRestoreBounds(window);
16 window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); 16 window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds));
17 } 17 }
18 18
19 void SetRestoreBoundsIfNotSet(aura::Window* window) { 19 void SetRestoreBoundsIfNotSet(aura::Window* window) {
20 if (!GetRestoreBounds(window)) 20 if (!GetRestoreBounds(window))
21 SetRestoreBounds(window, window->bounds()); 21 SetRestoreBounds(window, window->bounds());
22 } 22 }
23 23
24 const gfx::Rect* GetRestoreBounds(aura::Window* window) { 24 const gfx::Rect* GetRestoreBounds(aura::Window* window) {
25 return reinterpret_cast<gfx::Rect*>( 25 return reinterpret_cast<gfx::Rect*>(
26 window->GetProperty(aura::client::kRestoreBoundsKey)); 26 window->GetProperty(aura::client::kRestoreBoundsKey));
27 } 27 }
28 28
29 void ClearRestoreBounds(aura::Window* window) { 29 void ClearRestoreBounds(aura::Window* window) {
30 delete GetRestoreBounds(window); 30 delete GetRestoreBounds(window);
31 window->SetProperty(aura::client::kRestoreBoundsKey, NULL); 31 window->SetProperty(aura::client::kRestoreBoundsKey, NULL);
32 } 32 }
33 33
34 } 34 }
OLDNEW
« no previous file with comments | « ash/wm/property_util.h ('k') | ash/wm/root_window_event_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698