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

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

Issue 24108003: [Cleanup] Rename WindowSettings to WindowState (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase fix Created 7 years, 3 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 | « ash/wm/property_util.h ('k') | ash/wm/stacking_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/wm/property_util.h"
6
7 #include "ash/screen_ash.h"
8 #include "ash/wm/window_properties.h"
9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/window.h"
11 #include "ui/base/ui_base_types.h"
12 #include "ui/gfx/rect.h"
13
14 namespace ash {
15
16 void SetRestoreBoundsInScreen(aura::Window* window, const gfx::Rect& bounds) {
17 window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds));
18 }
19
20 void SetRestoreBoundsInParent(aura::Window* window, const gfx::Rect& bounds) {
21 SetRestoreBoundsInScreen(window,
22 ScreenAsh::ConvertRectToScreen(window->parent(), bounds));
23 }
24
25 const gfx::Rect* GetRestoreBoundsInScreen(aura::Window* window) {
26 return window->GetProperty(aura::client::kRestoreBoundsKey);
27 }
28
29 gfx::Rect GetRestoreBoundsInParent(aura::Window* window) {
30 const gfx::Rect* rect = GetRestoreBoundsInScreen(window);
31 if (!rect)
32 return gfx::Rect();
33 return ScreenAsh::ConvertRectFromScreen(window->parent(), *rect);
34 }
35
36 void ClearRestoreBounds(aura::Window* window) {
37 window->ClearProperty(aura::client::kRestoreBoundsKey);
38 }
39
40 void SetWindowAlwaysRestoresToRestoreBounds(aura::Window* window, bool value) {
41 window->SetProperty(internal::kWindowRestoresToRestoreBounds, value);
42 }
43
44 bool GetWindowAlwaysRestoresToRestoreBounds(const aura::Window* window) {
45 return window->GetProperty(internal::kWindowRestoresToRestoreBounds);
46 }
47
48 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/property_util.h ('k') | ash/wm/stacking_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698