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

Side by Side Diff: ash/keyboard/keyboard_observer_register.cc

Issue 2871813002: Converts remaining usage of WmLayoutManager to aura::LayoutManager (Closed)
Patch Set: cleanup Created 3 years, 7 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
« no previous file with comments | « ash/keyboard/keyboard_observer_register.h ('k') | ash/root_window_controller.h » ('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 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 "ash/keyboard/keyboard_observer_register.h" 5 #include "ash/keyboard/keyboard_observer_register.h"
6 6
7 #include "ui/keyboard/keyboard_controller.h" 7 #include "ui/keyboard/keyboard_controller.h"
8 8
9 namespace ash { 9 namespace ash {
10 10
11 void UpdateKeyboardObserverFromStateChanged( 11 void UpdateKeyboardObserverFromStateChanged(
12 bool keyboard_activated, 12 bool keyboard_activated,
13 WmWindow* keyboard_root_window, 13 aura::Window* keyboard_root_window,
14 WmWindow* observer_root_window, 14 aura::Window* observer_root_window,
15 ScopedObserver<keyboard::KeyboardController, 15 ScopedObserver<keyboard::KeyboardController,
16 keyboard::KeyboardControllerObserver>* keyboard_observer) { 16 keyboard::KeyboardControllerObserver>* keyboard_observer) {
17 if (keyboard_root_window != observer_root_window) 17 if (keyboard_root_window != observer_root_window)
18 return; 18 return;
19 19
20 keyboard::KeyboardController* const keyboard_controller = 20 keyboard::KeyboardController* const keyboard_controller =
21 keyboard::KeyboardController::GetInstance(); 21 keyboard::KeyboardController::GetInstance();
22 if (keyboard_activated && 22 if (keyboard_activated &&
23 !keyboard_observer->IsObserving(keyboard_controller)) { 23 !keyboard_observer->IsObserving(keyboard_controller)) {
24 keyboard_observer->Add(keyboard_controller); 24 keyboard_observer->Add(keyboard_controller);
25 } else if (!keyboard_activated && 25 } else if (!keyboard_activated &&
26 keyboard_observer->IsObserving(keyboard_controller)) { 26 keyboard_observer->IsObserving(keyboard_controller)) {
27 keyboard_observer->Remove(keyboard_controller); 27 keyboard_observer->Remove(keyboard_controller);
28 } 28 }
29 } 29 }
30 30
31 } // namespace ash 31 } // namespace ash
OLDNEW
« no previous file with comments | « ash/keyboard/keyboard_observer_register.h ('k') | ash/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698