OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/screen/screen_manager_impl.h" | 5 #include "athena/screen/screen_manager_impl.h" |
6 | 6 |
7 #include "athena/input/public/accelerator_manager.h" | 7 #include "athena/input/public/accelerator_manager.h" |
8 #include "athena/screen/modal_window_controller.h" | 8 #include "athena/screen/modal_window_controller.h" |
9 #include "athena/screen/screen_accelerator_handler.h" | 9 #include "athena/screen/screen_accelerator_handler.h" |
10 #include "athena/util/container_priorities.h" | 10 #include "athena/util/container_priorities.h" |
11 #include "athena/util/fill_layout_manager.h" | 11 #include "athena/util/fill_layout_manager.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "ui/aura/client/aura_constants.h" | 14 #include "ui/aura/client/aura_constants.h" |
15 #include "ui/aura/client/screen_position_client.h" | 15 #include "ui/aura/client/screen_position_client.h" |
16 #include "ui/aura/test/test_screen.h" | 16 #include "ui/aura/test/test_screen.h" |
17 #include "ui/aura/window.h" | 17 #include "ui/aura/window.h" |
18 #include "ui/aura/window_property.h" | 18 #include "ui/aura/window_property.h" |
19 #include "ui/aura/window_targeter.h" | 19 #include "ui/aura/window_targeter.h" |
20 #include "ui/aura/window_tree_host.h" | 20 #include "ui/aura/window_tree_host.h" |
21 #include "ui/gfx/display.h" | 21 #include "ui/gfx/display.h" |
22 #include "ui/gfx/screen.h" | 22 #include "ui/gfx/screen.h" |
23 #include "ui/wm/core/base_focus_rules.h" | 23 #include "ui/wm/core/base_focus_rules.h" |
24 #include "ui/wm/core/capture_controller.h" | 24 #include "ui/wm/core/capture_controller.h" |
| 25 #include "ui/wm/core/default_screen_position_client.h" |
25 #include "ui/wm/core/focus_controller.h" | 26 #include "ui/wm/core/focus_controller.h" |
26 #include "ui/wm/core/window_util.h" | 27 #include "ui/wm/core/window_util.h" |
27 | 28 |
28 // This is to avoid creating type definitoin for kAlwaysOnTopKey. | 29 // This is to avoid creating type definitoin for kAlwaysOnTopKey. |
29 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(ATHENA_EXPORT, bool); | 30 DECLARE_EXPORTED_WINDOW_PROPERTY_TYPE(ATHENA_EXPORT, bool); |
30 | 31 |
31 namespace athena { | 32 namespace athena { |
32 namespace { | 33 namespace { |
33 | 34 |
34 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ScreenManager::ContainerParams, | 35 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ScreenManager::ContainerParams, |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 aura::Window* next = wm::BaseFocusRules::GetNextActivatableWindow(ignore); | 114 aura::Window* next = wm::BaseFocusRules::GetNextActivatableWindow(ignore); |
114 // TODO(oshima): Search from activatable containers if |next| is nullptr. | 115 // TODO(oshima): Search from activatable containers if |next| is nullptr. |
115 // crbug.com/424750. | 116 // crbug.com/424750. |
116 return next; | 117 return next; |
117 } | 118 } |
118 | 119 |
119 private: | 120 private: |
120 DISALLOW_COPY_AND_ASSIGN(AthenaFocusRules); | 121 DISALLOW_COPY_AND_ASSIGN(AthenaFocusRules); |
121 }; | 122 }; |
122 | 123 |
123 class AthenaScreenPositionClient : public aura::client::ScreenPositionClient { | 124 class AthenaScreenPositionClient : public wm::DefaultScreenPositionClient { |
124 public: | 125 public: |
125 AthenaScreenPositionClient() { | 126 AthenaScreenPositionClient() { |
126 } | 127 } |
127 ~AthenaScreenPositionClient() override {} | 128 ~AthenaScreenPositionClient() override {} |
128 | 129 |
129 private: | 130 private: |
130 // aura::client::ScreenPositionClient: | 131 // aura::client::ScreenPositionClient: |
131 virtual void ConvertPointToScreen(const aura::Window* window, | 132 void ConvertHostPointToScreen(aura::Window* window, |
132 gfx::Point* point) override { | 133 gfx::Point* point) override { |
133 const aura::Window* root = window->GetRootWindow(); | |
134 aura::Window::ConvertPointToTarget(window, root, point); | |
135 } | |
136 | |
137 virtual void ConvertPointFromScreen(const aura::Window* window, | |
138 gfx::Point* point) override { | |
139 const aura::Window* root = window->GetRootWindow(); | |
140 aura::Window::ConvertPointToTarget(root, window, point); | |
141 } | |
142 | |
143 virtual void ConvertHostPointToScreen(aura::Window* window, | |
144 gfx::Point* point) override { | |
145 // TODO(oshima): Implement this when adding multiple display support. | 134 // TODO(oshima): Implement this when adding multiple display support. |
146 NOTREACHED(); | 135 NOTREACHED(); |
147 } | 136 } |
148 | 137 |
149 virtual void SetBounds(aura::Window* window, | |
150 const gfx::Rect& bounds, | |
151 const gfx::Display& display) override { | |
152 window->SetBounds(bounds); | |
153 } | |
154 | |
155 DISALLOW_COPY_AND_ASSIGN(AthenaScreenPositionClient); | 138 DISALLOW_COPY_AND_ASSIGN(AthenaScreenPositionClient); |
156 }; | 139 }; |
157 | 140 |
158 class AthenaWindowTargeter : public aura::WindowTargeter { | 141 class AthenaWindowTargeter : public aura::WindowTargeter { |
159 public: | 142 public: |
160 explicit AthenaWindowTargeter(aura::Window* root_window) | 143 explicit AthenaWindowTargeter(aura::Window* root_window) |
161 : root_window_(root_window) {} | 144 : root_window_(root_window) {} |
162 | 145 |
163 ~AthenaWindowTargeter() override {} | 146 ~AthenaWindowTargeter() override {} |
164 | 147 |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 } | 378 } |
396 | 379 |
397 // static | 380 // static |
398 void ScreenManager::Shutdown() { | 381 void ScreenManager::Shutdown() { |
399 DCHECK(instance); | 382 DCHECK(instance); |
400 delete instance; | 383 delete instance; |
401 DCHECK(!instance); | 384 DCHECK(!instance); |
402 } | 385 } |
403 | 386 |
404 } // namespace athena | 387 } // namespace athena |
OLD | NEW |