| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/exo/keyboard.h" | 5 #include "components/exo/keyboard.h" |
| 6 | 6 |
| 7 #include "components/exo/keyboard_delegate.h" | 7 #include "components/exo/keyboard_delegate.h" |
| 8 #include "components/exo/keyboard_device_configuration_delegate.h" | 8 #include "components/exo/keyboard_device_configuration_delegate.h" |
| 9 #include "components/exo/shell_surface.h" | 9 #include "components/exo/shell_surface.h" |
| 10 #include "components/exo/surface.h" | 10 #include "components/exo/surface.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 event->key_code() == ui::VKEY_BACK) { | 69 event->key_code() == ui::VKEY_BACK) { |
| 70 return true; | 70 return true; |
| 71 } | 71 } |
| 72 } | 72 } |
| 73 | 73 |
| 74 return false; | 74 return false; |
| 75 } | 75 } |
| 76 | 76 |
| 77 bool IsPhysicalKeyboardEnabled() { | 77 bool IsPhysicalKeyboardEnabled() { |
| 78 // The internal keyboard is enabled if maximize mode is not enabled. | 78 // The internal keyboard is enabled if maximize mode is not enabled. |
| 79 if (WMHelper::GetInstance()->IsMaximizeModeWindowManagerEnabled()) | 79 if (!WMHelper::GetInstance()->IsMaximizeModeWindowManagerEnabled()) |
| 80 return true; | 80 return true; |
| 81 | 81 |
| 82 for (auto& keyboard : | 82 for (auto& keyboard : |
| 83 ui::InputDeviceManager::GetInstance()->GetKeyboardDevices()) { | 83 ui::InputDeviceManager::GetInstance()->GetKeyboardDevices()) { |
| 84 if (keyboard.type != ui::InputDeviceType::INPUT_DEVICE_INTERNAL) | 84 if (keyboard.type != ui::InputDeviceType::INPUT_DEVICE_INTERNAL) |
| 85 return true; | 85 return true; |
| 86 } | 86 } |
| 87 return false; | 87 return false; |
| 88 } | 88 } |
| 89 | 89 |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 aura::Window* top_level_window = window->GetToplevelWindow(); | 236 aura::Window* top_level_window = window->GetToplevelWindow(); |
| 237 if (top_level_window) | 237 if (top_level_window) |
| 238 focus = ShellSurface::GetMainSurface(top_level_window); | 238 focus = ShellSurface::GetMainSurface(top_level_window); |
| 239 } | 239 } |
| 240 | 240 |
| 241 return focus && delegate_->CanAcceptKeyboardEventsForSurface(focus) ? focus | 241 return focus && delegate_->CanAcceptKeyboardEventsForSurface(focus) ? focus |
| 242 : nullptr; | 242 : nullptr; |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace exo | 245 } // namespace exo |
| OLD | NEW |