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 namespace { |
| 18 |
| 19 const char kOpenWindowSplitKey[] = "OpenWindowSplit"; |
| 20 |
| 21 } // namespace |
| 22 |
17 void ActivateWindow(aura::Window* window) { | 23 void ActivateWindow(aura::Window* window) { |
18 aura::client::GetActivationClient()->ActivateWindow(window); | 24 aura::client::GetActivationClient()->ActivateWindow(window); |
19 } | 25 } |
20 | 26 |
21 void DeactivateWindow(aura::Window* window) { | 27 void DeactivateWindow(aura::Window* window) { |
22 aura::client::GetActivationClient()->DeactivateWindow(window); | 28 aura::client::GetActivationClient()->DeactivateWindow(window); |
23 } | 29 } |
24 | 30 |
25 bool IsActiveWindow(aura::Window* window) { | 31 bool IsActiveWindow(aura::Window* window) { |
26 return GetActiveWindow() == window; | 32 return GetActiveWindow() == window; |
(...skipping 22 matching lines...) Expand all Loading... |
49 bool HasFullscreenWindow(const WindowSet& windows) { | 55 bool HasFullscreenWindow(const WindowSet& windows) { |
50 for (WindowSet::const_iterator i = windows.begin(); i != windows.end(); ++i) { | 56 for (WindowSet::const_iterator i = windows.begin(); i != windows.end(); ++i) { |
51 if ((*i)->GetIntProperty(aura::client::kShowStateKey) | 57 if ((*i)->GetIntProperty(aura::client::kShowStateKey) |
52 == ui::SHOW_STATE_FULLSCREEN) { | 58 == ui::SHOW_STATE_FULLSCREEN) { |
53 return true; | 59 return true; |
54 } | 60 } |
55 } | 61 } |
56 return false; | 62 return false; |
57 } | 63 } |
58 | 64 |
| 65 void SetOpenWindowSplit(aura::Window* window, bool value) { |
| 66 window->SetIntProperty(kOpenWindowSplitKey, value ? 1 : 0); |
| 67 } |
| 68 |
| 69 bool GetOpenWindowSplit(aura::Window* window) { |
| 70 return window->GetIntProperty(kOpenWindowSplitKey) == 1; |
| 71 } |
| 72 |
59 } // namespace window_util | 73 } // namespace window_util |
60 } // namespace ash | 74 } // namespace ash |
OLD | NEW |