OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 "ash/wm/window_util.h" | 5 #include "ash/wm/window_util.h" |
6 | 6 |
7 #include "ash/wm/activation_controller.h" | 7 #include "ash/wm/activation_controller.h" |
8 #include "ui/aura/client/activation_client.h" | 8 #include "ui/aura/client/activation_client.h" |
9 #include "ui/aura/client/aura_constants.h" | 9 #include "ui/aura/client/aura_constants.h" |
10 #include "ui/aura/root_window.h" | 10 #include "ui/aura/root_window.h" |
11 #include "ui/aura/window.h" | 11 #include "ui/aura/window.h" |
12 #include "ui/base/ui_base_types.h" | 12 #include "ui/base/ui_base_types.h" |
13 #include "ui/gfx/screen.h" | 13 #include "ui/gfx/screen.h" |
14 | 14 |
15 namespace ash { | 15 namespace ash { |
16 | 16 |
17 static const char kOpenWindowSplitKey[] = "OpenWindowSplit"; | |
oshima
2012/01/26 16:37:25
move this to anonymous namespace.
| |
18 | |
17 void ActivateWindow(aura::Window* window) { | 19 void ActivateWindow(aura::Window* window) { |
18 aura::client::GetActivationClient()->ActivateWindow(window); | 20 aura::client::GetActivationClient()->ActivateWindow(window); |
19 } | 21 } |
20 | 22 |
21 void DeactivateWindow(aura::Window* window) { | 23 void DeactivateWindow(aura::Window* window) { |
22 aura::client::GetActivationClient()->DeactivateWindow(window); | 24 aura::client::GetActivationClient()->DeactivateWindow(window); |
23 } | 25 } |
24 | 26 |
25 bool IsActiveWindow(aura::Window* window) { | 27 bool IsActiveWindow(aura::Window* window) { |
26 return GetActiveWindow() == window; | 28 return GetActiveWindow() == window; |
(...skipping 22 matching lines...) Expand all Loading... | |
49 bool HasFullscreenWindow(const WindowSet& windows) { | 51 bool HasFullscreenWindow(const WindowSet& windows) { |
50 for (WindowSet::const_iterator i = windows.begin(); i != windows.end(); ++i) { | 52 for (WindowSet::const_iterator i = windows.begin(); i != windows.end(); ++i) { |
51 if ((*i)->GetIntProperty(aura::client::kShowStateKey) | 53 if ((*i)->GetIntProperty(aura::client::kShowStateKey) |
52 == ui::SHOW_STATE_FULLSCREEN) { | 54 == ui::SHOW_STATE_FULLSCREEN) { |
53 return true; | 55 return true; |
54 } | 56 } |
55 } | 57 } |
56 return false; | 58 return false; |
57 } | 59 } |
58 | 60 |
61 void SetOpenWindowSplit(aura::Window* window, bool value) { | |
62 window->SetIntProperty(kOpenWindowSplitKey, value ? 1 : 0); | |
63 } | |
64 | |
65 bool GetOpenWindowSplit(aura::Window* window) { | |
66 return window->GetIntProperty(kOpenWindowSplitKey) == 1; | |
67 } | |
68 | |
59 } // namespace window_util | 69 } // namespace window_util |
60 } // namespace ash | 70 } // namespace ash |
OLD | NEW |