Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <algorithm> // std::find | 7 #include <algorithm> // std::find |
| 8 | 8 |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 734 if (Contains(active_input_method_ids, id)) | 734 if (Contains(active_input_method_ids, id)) |
| 735 ids.push_back(id); | 735 ids.push_back(id); |
| 736 } | 736 } |
| 737 if (ids.empty()) { | 737 if (ids.empty()) { |
| 738 // No input method for the accelerator is active. For example, we should | 738 // No input method for the accelerator is active. For example, we should |
| 739 // just ignore VKEY_HANGUL when mozc-hangul is not active. | 739 // just ignore VKEY_HANGUL when mozc-hangul is not active. |
| 740 return false; | 740 return false; |
| 741 } | 741 } |
| 742 | 742 |
| 743 SwitchToNextInputMethodInternal(ids, current_input_method.id()); | 743 SwitchToNextInputMethodInternal(ids, current_input_method.id()); |
| 744 return true; // consume the accelerator. | 744 |
| 745 // Consume if the triggering accelerator key may have a side-effect(unexpected | |
| 746 // character insertion or unexpected accelerator triggering). Here all | |
| 747 // incoming key code is only CONVERT/NONCONVERT/HANKAKU_ZENKAKU keys. Thus no | |
| 748 // need to consume keys since none of them have side-effect. | |
| 749 return false; | |
|
Shu Chen
2014/12/08 14:55:07
you may need to rebase this cl.
Seigo Nonaka
2014/12/09 09:27:32
Oh... the HEAD is quite different...
| |
| 745 } | 750 } |
| 746 | 751 |
| 747 void InputMethodManagerImpl::StateImpl::SwitchToNextInputMethodInternal( | 752 void InputMethodManagerImpl::StateImpl::SwitchToNextInputMethodInternal( |
| 748 const std::vector<std::string>& input_method_ids, | 753 const std::vector<std::string>& input_method_ids, |
| 749 const std::string& current_input_methodid) { | 754 const std::string& current_input_methodid) { |
| 750 std::vector<std::string>::const_iterator iter = std::find( | 755 std::vector<std::string>::const_iterator iter = std::find( |
| 751 input_method_ids.begin(), input_method_ids.end(), current_input_methodid); | 756 input_method_ids.begin(), input_method_ids.end(), current_input_methodid); |
| 752 if (iter != input_method_ids.end()) | 757 if (iter != input_method_ids.end()) |
| 753 ++iter; | 758 ++iter; |
| 754 if (iter == input_method_ids.end()) | 759 if (iter == input_method_ids.end()) |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1155 if (candidate_window_controller_.get()) | 1160 if (candidate_window_controller_.get()) |
| 1156 return; | 1161 return; |
| 1157 | 1162 |
| 1158 candidate_window_controller_.reset( | 1163 candidate_window_controller_.reset( |
| 1159 CandidateWindowController::CreateCandidateWindowController()); | 1164 CandidateWindowController::CreateCandidateWindowController()); |
| 1160 candidate_window_controller_->AddObserver(this); | 1165 candidate_window_controller_->AddObserver(this); |
| 1161 } | 1166 } |
| 1162 | 1167 |
| 1163 } // namespace input_method | 1168 } // namespace input_method |
| 1164 } // namespace chromeos | 1169 } // namespace chromeos |
| OLD | NEW |