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

Side by Side Diff: ui/chromeos/ime/input_method_menu_manager.cc

Issue 2422073002: Reduce FOR_EACH_OBSERVER usage in ui/ (Closed)
Patch Set: remove space 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 | « ui/chromeos/ime/candidate_window_view.cc ('k') | ui/chromeos/network/network_icon_animation.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "ui/chromeos/ime/input_method_menu_manager.h" 5 #include "ui/chromeos/ime/input_method_menu_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 InputMethodMenuItemList 30 InputMethodMenuItemList
31 InputMethodMenuManager::GetCurrentInputMethodMenuItemList() const { 31 InputMethodMenuManager::GetCurrentInputMethodMenuItemList() const {
32 return menu_list_; 32 return menu_list_;
33 } 33 }
34 34
35 void InputMethodMenuManager::SetCurrentInputMethodMenuItemList( 35 void InputMethodMenuManager::SetCurrentInputMethodMenuItemList(
36 const InputMethodMenuItemList& menu_list) { 36 const InputMethodMenuItemList& menu_list) {
37 menu_list_ = menu_list; 37 menu_list_ = menu_list;
38 FOR_EACH_OBSERVER(InputMethodMenuManager::Observer, 38 for (InputMethodMenuManager::Observer& observer : observers_)
39 observers_, 39 observer.InputMethodMenuItemChanged(this);
40 InputMethodMenuItemChanged(this));
41 } 40 }
42 41
43 bool InputMethodMenuManager::HasInputMethodMenuItemForKey( 42 bool InputMethodMenuManager::HasInputMethodMenuItemForKey(
44 const std::string& key) const { 43 const std::string& key) const {
45 for (size_t i = 0; i < menu_list_.size(); ++i) { 44 for (size_t i = 0; i < menu_list_.size(); ++i) {
46 if (menu_list_[i].key == key) { 45 if (menu_list_[i].key == key) {
47 return true; 46 return true;
48 } 47 }
49 } 48 }
50 return false; 49 return false;
51 } 50 }
52 51
53 // static 52 // static
54 InputMethodMenuManager* InputMethodMenuManager::GetInstance() { 53 InputMethodMenuManager* InputMethodMenuManager::GetInstance() {
55 return base::Singleton<InputMethodMenuManager>::get(); 54 return base::Singleton<InputMethodMenuManager>::get();
56 } 55 }
57 56
58 } // namespace ime 57 } // namespace ime
59 } // namespace ui 58 } // namespace ui
OLDNEW
« no previous file with comments | « ui/chromeos/ime/candidate_window_view.cc ('k') | ui/chromeos/network/network_icon_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698