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

Unified Diff: ash/common/keyboard/keyboard_ui.cc

Issue 2201323002: Simplify VirtualKeyboardTray (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some comments Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/common/keyboard/keyboard_ui_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/keyboard/keyboard_ui.cc
diff --git a/ash/common/keyboard/keyboard_ui.cc b/ash/common/keyboard/keyboard_ui.cc
index c9d2fe9c8c167b3a0ad9bdf11bec13bcedd0dc94..993b83eba18454a632397909f365e5fd76c52ee4 100644
--- a/ash/common/keyboard/keyboard_ui.cc
+++ b/ash/common/keyboard/keyboard_ui.cc
@@ -17,7 +17,7 @@ namespace ash {
class KeyboardUIImpl : public KeyboardUI, public AccessibilityObserver {
public:
- KeyboardUIImpl() {
+ KeyboardUIImpl() : enabled_(false) {
WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this);
}
@@ -41,11 +41,18 @@ class KeyboardUIImpl : public KeyboardUI, public AccessibilityObserver {
// AccessibilityObserver:
void OnAccessibilityModeChanged(
AccessibilityNotificationVisibility notify) override {
+ bool enabled = IsEnabled();
+ if (enabled_ == enabled)
+ return;
+
+ enabled_ = enabled;
FOR_EACH_OBSERVER(KeyboardUIObserver, *observers(),
- OnKeyboardEnabledStateChanged(IsEnabled()));
+ OnKeyboardEnabledStateChanged(enabled));
}
private:
+ bool enabled_;
+
DISALLOW_COPY_AND_ASSIGN(KeyboardUIImpl);
};
« no previous file with comments | « no previous file | ash/common/keyboard/keyboard_ui_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698