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

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

Issue 2567903003: exo: Produce an error if get_keyboard_device_configuration is called with a keyboard object that al… (Closed)
Patch Set: rebase 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 | « components/exo/keyboard.h ('k') | components/exo/wayland/server.cc » ('j') | 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 device_configuration_delegate_->OnKeyboardDestroying(this); 107 device_configuration_delegate_->OnKeyboardDestroying(this);
108 if (focus_) 108 if (focus_)
109 focus_->RemoveSurfaceObserver(this); 109 focus_->RemoveSurfaceObserver(this);
110 auto* helper = WMHelper::GetInstance(); 110 auto* helper = WMHelper::GetInstance();
111 helper->RemoveFocusObserver(this); 111 helper->RemoveFocusObserver(this);
112 helper->RemovePostTargetHandler(this); 112 helper->RemovePostTargetHandler(this);
113 helper->RemoveMaximizeModeObserver(this); 113 helper->RemoveMaximizeModeObserver(this);
114 helper->RemoveInputDeviceEventObserver(this); 114 helper->RemoveInputDeviceEventObserver(this);
115 } 115 }
116 116
117 bool Keyboard::HasDeviceConfigurationDelegate() const {
118 return !!device_configuration_delegate_;
119 }
120
117 void Keyboard::SetDeviceConfigurationDelegate( 121 void Keyboard::SetDeviceConfigurationDelegate(
118 KeyboardDeviceConfigurationDelegate* delegate) { 122 KeyboardDeviceConfigurationDelegate* delegate) {
119 device_configuration_delegate_ = delegate; 123 device_configuration_delegate_ = delegate;
120 OnKeyboardDeviceConfigurationChanged(); 124 OnKeyboardDeviceConfigurationChanged();
121 } 125 }
122 126
123 //////////////////////////////////////////////////////////////////////////////// 127 ////////////////////////////////////////////////////////////////////////////////
124 // ui::EventHandler overrides: 128 // ui::EventHandler overrides:
125 129
126 void Keyboard::OnKeyEvent(ui::KeyEvent* event) { 130 void Keyboard::OnKeyEvent(ui::KeyEvent* event) {
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 aura::Window* top_level_window = window->GetToplevelWindow(); 236 aura::Window* top_level_window = window->GetToplevelWindow();
233 if (top_level_window) 237 if (top_level_window)
234 focus = ShellSurface::GetMainSurface(top_level_window); 238 focus = ShellSurface::GetMainSurface(top_level_window);
235 } 239 }
236 240
237 return focus && delegate_->CanAcceptKeyboardEventsForSurface(focus) ? focus 241 return focus && delegate_->CanAcceptKeyboardEventsForSurface(focus) ? focus
238 : nullptr; 242 : nullptr;
239 } 243 }
240 244
241 } // namespace exo 245 } // namespace exo
OLDNEW
« no previous file with comments | « components/exo/keyboard.h ('k') | components/exo/wayland/server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698