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

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

Issue 680383008: Move ash/ime to ui/chromeos/ime (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@athena_do_not_use_ash48_global_command
Patch Set: Created 6 years, 1 month 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
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

Powered by Google App Engine
This is Rietveld 408576698