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

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

Issue 2704173002: Update the layout mode first when exiting tablet mode (Closed)
Patch Set: . Created 3 years, 10 months 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
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 } 214 }
215 } 215 }
216 216
217 //////////////////////////////////////////////////////////////////////////////// 217 ////////////////////////////////////////////////////////////////////////////////
218 // WMHelper::MaximizeModeObserver overrides: 218 // WMHelper::MaximizeModeObserver overrides:
219 219
220 void Keyboard::OnMaximizeModeStarted() { 220 void Keyboard::OnMaximizeModeStarted() {
221 OnKeyboardDeviceConfigurationChanged(); 221 OnKeyboardDeviceConfigurationChanged();
222 } 222 }
223 223
224 void Keyboard::OnMaximizeModeEnding() {}
225
224 void Keyboard::OnMaximizeModeEnded() { 226 void Keyboard::OnMaximizeModeEnded() {
225 OnKeyboardDeviceConfigurationChanged(); 227 OnKeyboardDeviceConfigurationChanged();
226 } 228 }
227 229
228 //////////////////////////////////////////////////////////////////////////////// 230 ////////////////////////////////////////////////////////////////////////////////
229 // Keyboard, private: 231 // Keyboard, private:
230 232
231 Surface* Keyboard::GetEffectiveFocus(aura::Window* window) const { 233 Surface* Keyboard::GetEffectiveFocus(aura::Window* window) const {
232 // Use window surface as effective focus. 234 // Use window surface as effective focus.
233 Surface* focus = Surface::AsSurface(window); 235 Surface* focus = Surface::AsSurface(window);
234 if (!focus) { 236 if (!focus) {
235 // Fallback to main surface. 237 // Fallback to main surface.
236 aura::Window* top_level_window = window->GetToplevelWindow(); 238 aura::Window* top_level_window = window->GetToplevelWindow();
237 if (top_level_window) 239 if (top_level_window)
238 focus = ShellSurface::GetMainSurface(top_level_window); 240 focus = ShellSurface::GetMainSurface(top_level_window);
239 } 241 }
240 242
241 return focus && delegate_->CanAcceptKeyboardEventsForSurface(focus) ? focus 243 return focus && delegate_->CanAcceptKeyboardEventsForSurface(focus) ? focus
242 : nullptr; 244 : nullptr;
243 } 245 }
244 246
245 } // namespace exo 247 } // namespace exo
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698