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

Side by Side Diff: ash/wm/window_settings.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/window_settings.h ('k') | ash/wm/window_state.h » ('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 2013 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/window_settings.h"
6
7 #include "ui/aura/window.h"
8 #include "ui/aura/window_property.h"
9 #include "ui/gfx/display.h"
10
11 DECLARE_WINDOW_PROPERTY_TYPE(ash::wm::WindowSettings*);
12
13 namespace ash {
14 namespace wm {
15
16 DEFINE_OWNED_WINDOW_PROPERTY_KEY(WindowSettings,
17 kWindowSettingsKey, NULL);
18
19 WindowSettings::WindowSettings(aura::Window* window)
20 : window_(window),
21 tracked_by_workspace_(true),
22 window_position_managed_(false),
23 bounds_changed_by_user_(false),
24 panel_attached_(true),
25 continue_drag_after_reparent_(false),
26 ignored_by_shelf_(false) {
27 }
28
29 WindowSettings::~WindowSettings() {
30 }
31
32 void WindowSettings::AddObserver(Observer* observer) {
33 observer_list_.AddObserver(observer);
34 }
35
36 void WindowSettings::RemoveObserver(Observer* observer) {
37 observer_list_.RemoveObserver(observer);
38 }
39
40 void WindowSettings::SetTrackedByWorkspace(bool tracked_by_workspace) {
41 if (tracked_by_workspace_ == tracked_by_workspace)
42 return;
43 bool old = tracked_by_workspace_;
44 tracked_by_workspace_ = tracked_by_workspace;
45 FOR_EACH_OBSERVER(Observer, observer_list_,
46 OnTrackedByWorkspaceChanged(window_, old));
47 }
48
49 WindowSettings* GetWindowSettings(aura::Window* window) {
50 WindowSettings* settings = window->GetProperty(kWindowSettingsKey);
51 if(!settings) {
52 settings = new WindowSettings(window);
53 window->SetProperty(kWindowSettingsKey, settings);
54 }
55 return settings;
56 }
57
58 const WindowSettings* GetWindowSettings(const aura::Window* window) {
59 return GetWindowSettings(const_cast<aura::Window*>(window));
60 }
61
62 } // namespace wm
63 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/window_settings.h ('k') | ash/wm/window_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698