Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Side by Side Diff: components/exo/keyboard.cc

Issue 2590893002: exo: Fix logic in |IsPhysicalKeyboardEnabled()|. (Closed)
Patch Set: fix commit message. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698