| 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" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 aura::Window* GetContainer(aura::Window* window) { | 73 aura::Window* GetContainer(aura::Window* window) { |
| 74 aura::Window* container = window; | 74 aura::Window* container = window; |
| 75 while (container && !container->GetProperty(kContainerParamsKey)) | 75 while (container && !container->GetProperty(kContainerParamsKey)) |
| 76 container = container->parent(); | 76 container = container->parent(); |
| 77 return container; | 77 return container; |
| 78 } | 78 } |
| 79 | 79 |
| 80 class AthenaFocusRules : public wm::BaseFocusRules { | 80 class AthenaFocusRules : public wm::BaseFocusRules { |
| 81 public: | 81 public: |
| 82 AthenaFocusRules() {} | 82 AthenaFocusRules() {} |
| 83 virtual ~AthenaFocusRules() {} | 83 ~AthenaFocusRules() override {} |
| 84 | 84 |
| 85 // wm::BaseFocusRules: | 85 // wm::BaseFocusRules: |
| 86 virtual bool SupportsChildActivation(aura::Window* window) const override { | 86 virtual bool SupportsChildActivation(aura::Window* window) const override { |
| 87 ScreenManager::ContainerParams* params = | 87 ScreenManager::ContainerParams* params = |
| 88 window->GetProperty(kContainerParamsKey); | 88 window->GetProperty(kContainerParamsKey); |
| 89 return params && params->can_activate_children; | 89 return params && params->can_activate_children; |
| 90 } | 90 } |
| 91 virtual bool CanActivateWindow(aura::Window* window) const override { | 91 virtual bool CanActivateWindow(aura::Window* window) const override { |
| 92 if (!window) | 92 if (!window) |
| 93 return true; | 93 return true; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 117 } | 117 } |
| 118 | 118 |
| 119 private: | 119 private: |
| 120 DISALLOW_COPY_AND_ASSIGN(AthenaFocusRules); | 120 DISALLOW_COPY_AND_ASSIGN(AthenaFocusRules); |
| 121 }; | 121 }; |
| 122 | 122 |
| 123 class AthenaScreenPositionClient : public aura::client::ScreenPositionClient { | 123 class AthenaScreenPositionClient : public aura::client::ScreenPositionClient { |
| 124 public: | 124 public: |
| 125 AthenaScreenPositionClient() { | 125 AthenaScreenPositionClient() { |
| 126 } | 126 } |
| 127 virtual ~AthenaScreenPositionClient() { | 127 ~AthenaScreenPositionClient() override {} |
| 128 } | |
| 129 | 128 |
| 130 private: | 129 private: |
| 131 // aura::client::ScreenPositionClient: | 130 // aura::client::ScreenPositionClient: |
| 132 virtual void ConvertPointToScreen(const aura::Window* window, | 131 virtual void ConvertPointToScreen(const aura::Window* window, |
| 133 gfx::Point* point) override { | 132 gfx::Point* point) override { |
| 134 const aura::Window* root = window->GetRootWindow(); | 133 const aura::Window* root = window->GetRootWindow(); |
| 135 aura::Window::ConvertPointToTarget(window, root, point); | 134 aura::Window::ConvertPointToTarget(window, root, point); |
| 136 } | 135 } |
| 137 | 136 |
| 138 virtual void ConvertPointFromScreen(const aura::Window* window, | 137 virtual void ConvertPointFromScreen(const aura::Window* window, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 154 } | 153 } |
| 155 | 154 |
| 156 DISALLOW_COPY_AND_ASSIGN(AthenaScreenPositionClient); | 155 DISALLOW_COPY_AND_ASSIGN(AthenaScreenPositionClient); |
| 157 }; | 156 }; |
| 158 | 157 |
| 159 class AthenaWindowTargeter : public aura::WindowTargeter { | 158 class AthenaWindowTargeter : public aura::WindowTargeter { |
| 160 public: | 159 public: |
| 161 explicit AthenaWindowTargeter(aura::Window* root_window) | 160 explicit AthenaWindowTargeter(aura::Window* root_window) |
| 162 : root_window_(root_window) {} | 161 : root_window_(root_window) {} |
| 163 | 162 |
| 164 virtual ~AthenaWindowTargeter() {} | 163 ~AthenaWindowTargeter() override {} |
| 165 | 164 |
| 166 private: | 165 private: |
| 167 // aura::WindowTargeter: | 166 // aura::WindowTargeter: |
| 168 virtual bool SubtreeCanAcceptEvent( | 167 virtual bool SubtreeCanAcceptEvent( |
| 169 ui::EventTarget* target, | 168 ui::EventTarget* target, |
| 170 const ui::LocatedEvent& event) const override { | 169 const ui::LocatedEvent& event) const override { |
| 171 const aura::Window::Windows& containers = root_window_->children(); | 170 const aura::Window::Windows& containers = root_window_->children(); |
| 172 auto r_iter = | 171 auto r_iter = |
| 173 std::find_if(containers.rbegin(), containers.rend(), &BlockEvents); | 172 std::find_if(containers.rbegin(), containers.rend(), &BlockEvents); |
| 174 if (r_iter == containers.rend()) | 173 if (r_iter == containers.rend()) |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 } | 395 } |
| 397 | 396 |
| 398 // static | 397 // static |
| 399 void ScreenManager::Shutdown() { | 398 void ScreenManager::Shutdown() { |
| 400 DCHECK(instance); | 399 DCHECK(instance); |
| 401 delete instance; | 400 delete instance; |
| 402 DCHECK(!instance); | 401 DCHECK(!instance); |
| 403 } | 402 } |
| 404 | 403 |
| 405 } // namespace athena | 404 } // namespace athena |
| OLD | NEW |