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

Side by Side Diff: ash/common/keyboard/keyboard_ui.cc

Issue 2775973002: Promotes more accessors from WmShell to Shell (Closed)
Patch Set: feedback Created 3 years, 9 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/common/accelerators/accelerator_controller.cc ('k') | ash/common/mojo_interface_factory.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/common/keyboard/keyboard_ui.h" 5 #include "ash/common/keyboard/keyboard_ui.h"
6 6
7 #include "ash/common/accessibility_delegate.h" 7 #include "ash/common/accessibility_delegate.h"
8 #include "ash/common/keyboard/keyboard_ui_observer.h" 8 #include "ash/common/keyboard/keyboard_ui_observer.h"
9 #include "ash/common/system/accessibility_observer.h" 9 #include "ash/common/system/accessibility_observer.h"
10 #include "ash/common/system/tray/system_tray_notifier.h" 10 #include "ash/common/system/tray/system_tray_notifier.h"
11 #include "ash/common/system/tray_accessibility.h" 11 #include "ash/common/system/tray_accessibility.h"
12 #include "ash/common/wm_shell.h"
13 #include "ash/shell.h" 12 #include "ash/shell.h"
14 #include "base/memory/ptr_util.h" 13 #include "base/memory/ptr_util.h"
15 #include "ui/keyboard/keyboard_controller.h" 14 #include "ui/keyboard/keyboard_controller.h"
16 15
17 namespace ash { 16 namespace ash {
18 17
19 class KeyboardUIImpl : public KeyboardUI, public AccessibilityObserver { 18 class KeyboardUIImpl : public KeyboardUI, public AccessibilityObserver {
20 public: 19 public:
21 KeyboardUIImpl() : enabled_(false) { 20 KeyboardUIImpl() : enabled_(false) {
22 WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); 21 Shell::Get()->system_tray_notifier()->AddAccessibilityObserver(this);
23 } 22 }
24 23
25 ~KeyboardUIImpl() override { 24 ~KeyboardUIImpl() override {
26 if (WmShell::HasInstance() && WmShell::Get()->system_tray_notifier()) 25 if (Shell::HasInstance() && Shell::Get()->system_tray_notifier())
27 WmShell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this); 26 Shell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this);
28 } 27 }
29 28
30 // KeyboardUI: 29 // KeyboardUI:
31 void Show() override { 30 void Show() override {
32 keyboard::KeyboardController::GetInstance()->ShowKeyboard(true); 31 keyboard::KeyboardController::GetInstance()->ShowKeyboard(true);
33 } 32 }
34 void ShowInDisplay(const int64_t display_id) override { 33 void ShowInDisplay(const int64_t display_id) override {
35 keyboard::KeyboardController::GetInstance()->ShowKeyboardInDisplay( 34 keyboard::KeyboardController::GetInstance()->ShowKeyboardInDisplay(
36 display_id); 35 display_id);
37 } 36 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 observers_.AddObserver(observer); 73 observers_.AddObserver(observer);
75 } 74 }
76 75
77 void KeyboardUI::RemoveObserver(KeyboardUIObserver* observer) { 76 void KeyboardUI::RemoveObserver(KeyboardUIObserver* observer) {
78 observers_.RemoveObserver(observer); 77 observers_.RemoveObserver(observer);
79 } 78 }
80 79
81 KeyboardUI::KeyboardUI() {} 80 KeyboardUI::KeyboardUI() {}
82 81
83 } // namespace ash 82 } // namespace ash
OLDNEW
« no previous file with comments | « ash/common/accelerators/accelerator_controller.cc ('k') | ash/common/mojo_interface_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698