OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 // TODO(yusukes): For a window which isn't on top, probably it's better to | 137 // TODO(yusukes): For a window which isn't on top, probably it's better to |
138 // update the texts when the window gets activated because SetTooltipText() | 138 // update the texts when the window gets activated because SetTooltipText() |
139 // and SetText() are also expensive. | 139 // and SetText() are also expensive. |
140 } | 140 } |
141 | 141 |
142 void InputMethodMenuButton::OpenConfigUI() { | 142 void InputMethodMenuButton::OpenConfigUI() { |
143 // Ask browser to open the WebUI page. | 143 // Ask browser to open the WebUI page. |
144 delegate()->ExecuteStatusAreaCommand( | 144 delegate()->ExecuteStatusAreaCommand( |
145 this, StatusAreaViewChromeos::SHOW_LANGUAGE_OPTIONS); | 145 this, StatusAreaButton::Delegate::SHOW_LANGUAGE_OPTIONS); |
146 } | 146 } |
147 | 147 |
148 bool InputMethodMenuButton::ShouldSupportConfigUI() { | 148 bool InputMethodMenuButton::ShouldSupportConfigUI() { |
149 return delegate()->ShouldExecuteStatusAreaCommand( | 149 return delegate()->ShouldExecuteStatusAreaCommand( |
150 this, StatusAreaViewChromeos::SHOW_LANGUAGE_OPTIONS); | 150 this, StatusAreaButton::Delegate::SHOW_LANGUAGE_OPTIONS); |
151 } | 151 } |
152 | 152 |
153 void InputMethodMenuButton::UpdateUIFromCurrentInputMethod() { | 153 void InputMethodMenuButton::UpdateUIFromCurrentInputMethod() { |
154 input_method::InputMethodManager* input_method_manager = | 154 input_method::InputMethodManager* input_method_manager = |
155 input_method::InputMethodManager::GetInstance(); | 155 input_method::InputMethodManager::GetInstance(); |
156 const input_method::InputMethodDescriptor& input_method = | 156 const input_method::InputMethodDescriptor& input_method = |
157 input_method_manager->current_input_method(); | 157 input_method_manager->current_input_method(); |
158 const string16 name = InputMethodMenu::GetTextForIndicator(input_method); | 158 const string16 name = InputMethodMenu::GetTextForIndicator(input_method); |
159 const string16 tooltip = InputMethodMenu::GetTextForMenu(input_method); | 159 const string16 tooltip = InputMethodMenu::GetTextForMenu(input_method); |
160 const size_t num_active_input_methods = | 160 const size_t num_active_input_methods = |
161 input_method_manager->GetNumActiveInputMethods(); | 161 input_method_manager->GetNumActiveInputMethods(); |
162 UpdateUI(input_method.id(), name, tooltip, num_active_input_methods); | 162 UpdateUI(input_method.id(), name, tooltip, num_active_input_methods); |
163 } | 163 } |
164 | 164 |
165 } // namespace chromeos | 165 } // namespace chromeos |
OLD | NEW |