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

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

Issue 2421853003: Remove usage of FOR_EACH_OBSERVER macro in ash/ (Closed)
Patch Set: shell_observers Created 4 years, 2 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/aura/wm_shell_aura.cc ('k') | ash/display/display_manager.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"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 // AccessibilityObserver: 41 // AccessibilityObserver:
42 void OnAccessibilityModeChanged( 42 void OnAccessibilityModeChanged(
43 AccessibilityNotificationVisibility notify) override { 43 AccessibilityNotificationVisibility notify) override {
44 bool enabled = IsEnabled(); 44 bool enabled = IsEnabled();
45 if (enabled_ == enabled) 45 if (enabled_ == enabled)
46 return; 46 return;
47 47
48 enabled_ = enabled; 48 enabled_ = enabled;
49 FOR_EACH_OBSERVER(KeyboardUIObserver, *observers(), 49 for (auto& observer : *observers())
50 OnKeyboardEnabledStateChanged(enabled)); 50 observer.OnKeyboardEnabledStateChanged(enabled);
51 } 51 }
52 52
53 private: 53 private:
54 bool enabled_; 54 bool enabled_;
55 55
56 DISALLOW_COPY_AND_ASSIGN(KeyboardUIImpl); 56 DISALLOW_COPY_AND_ASSIGN(KeyboardUIImpl);
57 }; 57 };
58 58
59 KeyboardUI::~KeyboardUI() {} 59 KeyboardUI::~KeyboardUI() {}
60 60
61 // static 61 // static
62 std::unique_ptr<KeyboardUI> KeyboardUI::Create() { 62 std::unique_ptr<KeyboardUI> KeyboardUI::Create() {
63 return base::WrapUnique(new KeyboardUIImpl); 63 return base::WrapUnique(new KeyboardUIImpl);
64 } 64 }
65 65
66 void KeyboardUI::AddObserver(KeyboardUIObserver* observer) { 66 void KeyboardUI::AddObserver(KeyboardUIObserver* observer) {
67 observers_.AddObserver(observer); 67 observers_.AddObserver(observer);
68 } 68 }
69 69
70 void KeyboardUI::RemoveObserver(KeyboardUIObserver* observer) { 70 void KeyboardUI::RemoveObserver(KeyboardUIObserver* observer) {
71 observers_.RemoveObserver(observer); 71 observers_.RemoveObserver(observer);
72 } 72 }
73 73
74 KeyboardUI::KeyboardUI() {} 74 KeyboardUI::KeyboardUI() {}
75 75
76 } // namespace ash 76 } // namespace ash
OLDNEW
« no previous file with comments | « ash/aura/wm_shell_aura.cc ('k') | ash/display/display_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698