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: chrome/browser/chromeos/input_method/input_method_manager_impl.cc

Issue 1552743003: Add chrome.inputMethodPrivate.onImeMenuActivationChanged API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/chromeos/input_method/input_method_manager_impl.h" 5 #include "chrome/browser/chromeos/input_method/input_method_manager_impl.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <algorithm> // std::find 8 #include <algorithm> // std::find
9 #include <sstream> 9 #include <sstream>
10 #include <utility> 10 #include <utility>
(...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after
882 void InputMethodManagerImpl::AddObserver( 882 void InputMethodManagerImpl::AddObserver(
883 InputMethodManager::Observer* observer) { 883 InputMethodManager::Observer* observer) {
884 observers_.AddObserver(observer); 884 observers_.AddObserver(observer);
885 } 885 }
886 886
887 void InputMethodManagerImpl::AddCandidateWindowObserver( 887 void InputMethodManagerImpl::AddCandidateWindowObserver(
888 InputMethodManager::CandidateWindowObserver* observer) { 888 InputMethodManager::CandidateWindowObserver* observer) {
889 candidate_window_observers_.AddObserver(observer); 889 candidate_window_observers_.AddObserver(observer);
890 } 890 }
891 891
892 void InputMethodManagerImpl::AddImeMenuObserver(
893 InputMethodManager::ImeMenuObserver* observer) {
894 ime_menu_observers_.AddObserver(observer);
895 }
896
892 void InputMethodManagerImpl::RemoveObserver( 897 void InputMethodManagerImpl::RemoveObserver(
893 InputMethodManager::Observer* observer) { 898 InputMethodManager::Observer* observer) {
894 observers_.RemoveObserver(observer); 899 observers_.RemoveObserver(observer);
895 } 900 }
896 901
897 void InputMethodManagerImpl::RemoveCandidateWindowObserver( 902 void InputMethodManagerImpl::RemoveCandidateWindowObserver(
898 InputMethodManager::CandidateWindowObserver* observer) { 903 InputMethodManager::CandidateWindowObserver* observer) {
899 candidate_window_observers_.RemoveObserver(observer); 904 candidate_window_observers_.RemoveObserver(observer);
900 } 905 }
901 906
907 void InputMethodManagerImpl::RemoveImeMenuObserver(
908 InputMethodManager::ImeMenuObserver* observer) {
909 ime_menu_observers_.RemoveObserver(observer);
910 }
911
902 InputMethodManager::UISessionState InputMethodManagerImpl::GetUISessionState() { 912 InputMethodManager::UISessionState InputMethodManagerImpl::GetUISessionState() {
903 return ui_session_; 913 return ui_session_;
904 } 914 }
905 915
906 void InputMethodManagerImpl::SetUISessionState(UISessionState new_ui_session) { 916 void InputMethodManagerImpl::SetUISessionState(UISessionState new_ui_session) {
907 ui_session_ = new_ui_session; 917 ui_session_ = new_ui_session;
908 switch (ui_session_) { 918 switch (ui_session_) {
909 case STATE_LOGIN_SCREEN: 919 case STATE_LOGIN_SCREEN:
910 break; 920 break;
911 case STATE_BROWSER_SCREEN: 921 case STATE_BROWSER_SCREEN:
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1146 candidate_window_observers_, 1156 candidate_window_observers_,
1147 CandidateWindowOpened(this)); 1157 CandidateWindowOpened(this));
1148 } 1158 }
1149 1159
1150 void InputMethodManagerImpl::CandidateWindowClosed() { 1160 void InputMethodManagerImpl::CandidateWindowClosed() {
1151 FOR_EACH_OBSERVER(InputMethodManager::CandidateWindowObserver, 1161 FOR_EACH_OBSERVER(InputMethodManager::CandidateWindowObserver,
1152 candidate_window_observers_, 1162 candidate_window_observers_,
1153 CandidateWindowClosed(this)); 1163 CandidateWindowClosed(this));
1154 } 1164 }
1155 1165
1166 void InputMethodManagerImpl::ImeMenuActivationChanged(bool is_active) {
1167 FOR_EACH_OBSERVER(InputMethodManager::ImeMenuObserver, ime_menu_observers_,
1168 ImeMenuActivationChanged(is_active));
1169 }
1170
1156 void InputMethodManagerImpl::MaybeInitializeCandidateWindowController() { 1171 void InputMethodManagerImpl::MaybeInitializeCandidateWindowController() {
1157 if (candidate_window_controller_.get()) 1172 if (candidate_window_controller_.get())
1158 return; 1173 return;
1159 1174
1160 candidate_window_controller_.reset( 1175 candidate_window_controller_.reset(
1161 CandidateWindowController::CreateCandidateWindowController()); 1176 CandidateWindowController::CreateCandidateWindowController());
1162 candidate_window_controller_->AddObserver(this); 1177 candidate_window_controller_->AddObserver(this);
1163 } 1178 }
1164 1179
1165 } // namespace input_method 1180 } // namespace input_method
1166 } // namespace chromeos 1181 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698