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

Side by Side Diff: ash/ime/input_method_menu_manager.cc

Issue 165783002: Reland of: Split out InputMethodMenuManager from InputMethodManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review comment; spelling Created 6 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « ash/ime/input_method_menu_manager.h ('k') | ash/ime/input_method_menu_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ash/ime/input_method_menu_manager.h"
6
7 #include "base/logging.h"
8 #include "base/memory/singleton.h"
9
10 namespace ash {
11 namespace ime {
12
13 InputMethodMenuManager::InputMethodMenuManager()
14 : menu_list_(), observers_() {}
15
16 InputMethodMenuManager::~InputMethodMenuManager() {}
17
18 void InputMethodMenuManager::AddObserver(
19 InputMethodMenuManager::Observer* observer) {
20 observers_.AddObserver(observer);
21 }
22
23 void InputMethodMenuManager::RemoveObserver(
24 InputMethodMenuManager::Observer* observer) {
25 observers_.RemoveObserver(observer);
26 }
27
28 InputMethodMenuItemList
29 InputMethodMenuManager::GetCurrentInputMethodMenuItemList() const {
30 return menu_list_;
31 }
32
33 void InputMethodMenuManager::SetCurrentInputMethodMenuItemList(
34 const InputMethodMenuItemList& menu_list) {
35 menu_list_ = menu_list;
36 FOR_EACH_OBSERVER(InputMethodMenuManager::Observer,
37 observers_,
38 InputMethodMenuItemChanged(this));
39 }
40
41 bool InputMethodMenuManager::HasInputMethodMenuItemForKey(
42 const std::string& key) const {
43 for (size_t i = 0; i < menu_list_.size(); ++i) {
44 if (menu_list_[i].key == key) {
45 return true;
46 }
47 }
48 return false;
49 }
50
51 // static
52 InputMethodMenuManager* InputMethodMenuManager::GetInstance() {
53 return Singleton<InputMethodMenuManager>::get();
54 }
55
56 } // namespace ime
57 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ime/input_method_menu_manager.h ('k') | ash/ime/input_method_menu_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698