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/public/screen_manager.h" | 5 #include "athena/screen/public/screen_manager.h" |
6 | 6 |
7 #include "athena/common/container_priorities.h" | 7 #include "athena/common/container_priorities.h" |
8 #include "athena/common/fill_layout_manager.h" | 8 #include "athena/common/fill_layout_manager.h" |
9 #include "athena/input/public/accelerator_manager.h" | 9 #include "athena/input/public/accelerator_manager.h" |
10 #include "athena/screen/background_controller.h" | 10 #include "athena/screen/background_controller.h" |
11 #include "athena/screen/screen_accelerator_handler.h" | 11 #include "athena/screen/screen_accelerator_handler.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/screen_position_client.h" | 14 #include "ui/aura/client/screen_position_client.h" |
15 #include "ui/aura/client/window_tree_client.h" | 15 #include "ui/aura/client/window_tree_client.h" |
16 #include "ui/aura/layout_manager.h" | 16 #include "ui/aura/layout_manager.h" |
17 #include "ui/aura/test/test_screen.h" | 17 #include "ui/aura/test/test_screen.h" |
18 #include "ui/aura/window.h" | 18 #include "ui/aura/window.h" |
19 #include "ui/aura/window_property.h" | 19 #include "ui/aura/window_property.h" |
20 #include "ui/aura/window_targeter.h" | 20 #include "ui/aura/window_targeter.h" |
21 #include "ui/aura/window_tree_host.h" | 21 #include "ui/aura/window_tree_host.h" |
22 #include "ui/compositor/layer.h" | 22 #include "ui/compositor/layer.h" |
23 #include "ui/gfx/display.h" | 23 #include "ui/gfx/display.h" |
24 #include "ui/gfx/screen.h" | 24 #include "ui/gfx/screen.h" |
25 #include "ui/wm/core/base_focus_rules.h" | 25 #include "ui/wm/core/base_focus_rules.h" |
26 #include "ui/wm/core/capture_controller.h" | 26 #include "ui/wm/core/capture_controller.h" |
27 #include "ui/wm/core/focus_controller.h" | 27 #include "ui/wm/core/focus_controller.h" |
28 #include "ui/wm/core/window_util.h" | |
28 | 29 |
29 namespace athena { | 30 namespace athena { |
30 namespace { | 31 namespace { |
31 | 32 |
32 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ScreenManager::ContainerParams, | 33 DEFINE_OWNED_WINDOW_PROPERTY_KEY(ScreenManager::ContainerParams, |
33 kContainerParamsKey, | 34 kContainerParamsKey, |
34 NULL); | 35 NULL); |
35 | 36 |
36 ScreenManager* instance = NULL; | 37 ScreenManager* instance = NULL; |
37 | 38 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 explicit AthenaWindowTreeClient(aura::Window* container) | 89 explicit AthenaWindowTreeClient(aura::Window* container) |
89 : container_(container) {} | 90 : container_(container) {} |
90 | 91 |
91 private: | 92 private: |
92 virtual ~AthenaWindowTreeClient() {} | 93 virtual ~AthenaWindowTreeClient() {} |
93 | 94 |
94 // aura::client::WindowTreeClient: | 95 // aura::client::WindowTreeClient: |
95 virtual aura::Window* GetDefaultParent(aura::Window* context, | 96 virtual aura::Window* GetDefaultParent(aura::Window* context, |
96 aura::Window* window, | 97 aura::Window* window, |
97 const gfx::Rect& bounds) OVERRIDE { | 98 const gfx::Rect& bounds) OVERRIDE { |
99 aura::Window* transient_parent = wm::GetTransientParent(window); | |
100 if (transient_parent) { | |
101 aura::Window* container = transient_parent->parent(); | |
102 while (container && container->type() != ui::wm::WINDOW_TYPE_UNKNOWN) | |
103 container = container->parent(); | |
104 return container; | |
oshima
2014/09/04 00:23:35
can you check if the window has ContainerParams in
mohsen
2014/09/04 14:57:22
I just saw that there is a GetContainer() function
| |
105 } | |
98 return container_; | 106 return container_; |
99 } | 107 } |
100 | 108 |
101 aura::Window* container_; | 109 aura::Window* container_; |
102 | 110 |
103 DISALLOW_COPY_AND_ASSIGN(AthenaWindowTreeClient); | 111 DISALLOW_COPY_AND_ASSIGN(AthenaWindowTreeClient); |
104 }; | 112 }; |
105 | 113 |
106 class AthenaScreenPositionClient : public aura::client::ScreenPositionClient { | 114 class AthenaScreenPositionClient : public aura::client::ScreenPositionClient { |
107 public: | 115 public: |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
384 } | 392 } |
385 | 393 |
386 // static | 394 // static |
387 void ScreenManager::Shutdown() { | 395 void ScreenManager::Shutdown() { |
388 DCHECK(instance); | 396 DCHECK(instance); |
389 delete instance; | 397 delete instance; |
390 DCHECK(!instance); | 398 DCHECK(!instance); |
391 } | 399 } |
392 | 400 |
393 } // namespace athena | 401 } // namespace athena |
OLD | NEW |