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/status/input_method_menu_button.h" | 5 #include "chrome/browser/chromeos/status/input_method_menu_button.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 10 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 bool InputMethodMenuButton::ShouldSupportConfigUI() { | 146 bool InputMethodMenuButton::ShouldSupportConfigUI() { |
147 return delegate()->ShouldExecuteStatusAreaCommand( | 147 return delegate()->ShouldExecuteStatusAreaCommand( |
148 this, StatusAreaButton::Delegate::SHOW_LANGUAGE_OPTIONS); | 148 this, StatusAreaButton::Delegate::SHOW_LANGUAGE_OPTIONS); |
149 } | 149 } |
150 | 150 |
151 void InputMethodMenuButton::UpdateUIFromCurrentInputMethod() { | 151 void InputMethodMenuButton::UpdateUIFromCurrentInputMethod() { |
152 input_method::InputMethodManager* input_method_manager = | 152 input_method::InputMethodManager* input_method_manager = |
153 input_method::InputMethodManager::GetInstance(); | 153 input_method::InputMethodManager::GetInstance(); |
154 const input_method::InputMethodDescriptor& input_method = | 154 const input_method::InputMethodDescriptor& input_method = |
155 input_method_manager->current_input_method(); | 155 input_method_manager->GetCurrentInputMethod(); |
156 const string16 name = InputMethodMenu::GetTextForIndicator(input_method); | 156 const string16 name = InputMethodMenu::GetTextForIndicator(input_method); |
157 const string16 tooltip = InputMethodMenu::GetTextForMenu(input_method); | 157 const string16 tooltip = InputMethodMenu::GetTextForMenu(input_method); |
158 const size_t num_active_input_methods = | 158 const size_t num_active_input_methods = |
159 input_method_manager->GetNumActiveInputMethods(); | 159 input_method_manager->GetNumActiveInputMethods(); |
160 UpdateUI(input_method.id(), name, tooltip, num_active_input_methods); | 160 UpdateUI(input_method.id(), name, tooltip, num_active_input_methods); |
161 } | 161 } |
162 | 162 |
163 } // namespace chromeos | 163 } // namespace chromeos |
OLD | NEW |