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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 void InputMethodMenuButton::OnLocaleChanged() { | 77 void InputMethodMenuButton::OnLocaleChanged() { |
78 input_method::InputMethodManager* manager = | 78 input_method::InputMethodManager* manager = |
79 input_method::InputMethodManager::GetInstance(); | 79 input_method::InputMethodManager::GetInstance(); |
80 manager->GetInputMethodUtil()->OnLocaleChanged(); | 80 manager->GetInputMethodUtil()->OnLocaleChanged(); |
81 UpdateUIFromCurrentInputMethod(); | 81 UpdateUIFromCurrentInputMethod(); |
82 Layout(); | 82 Layout(); |
83 SchedulePaint(); | 83 SchedulePaint(); |
84 } | 84 } |
85 | 85 |
86 //////////////////////////////////////////////////////////////////////////////// | 86 //////////////////////////////////////////////////////////////////////////////// |
87 // views::MenuButtonDelegate implementation: | 87 // views::MenuButtonListener implementation: |
88 | 88 |
89 void InputMethodMenuButton::RunMenu(views::View* unused_source, | 89 void InputMethodMenuButton::OnMenuButtonClicked(views::View* source, |
90 const gfx::Point& pt) { | 90 const gfx::Point& point) { |
91 menu_->RunMenu(unused_source, pt); | 91 menu_->OnMenuButtonClicked(source, point); |
92 } | 92 } |
93 | 93 |
94 bool InputMethodMenuButton::WindowIsActive() { | 94 bool InputMethodMenuButton::WindowIsActive() { |
95 Browser* active_browser = BrowserList::GetLastActive(); | 95 Browser* active_browser = BrowserList::GetLastActive(); |
96 if (!active_browser) { | 96 if (!active_browser) { |
97 // Can't get an active browser. Just return true, which is safer. | 97 // Can't get an active browser. Just return true, which is safer. |
98 return true; | 98 return true; |
99 } | 99 } |
100 BrowserWindow* active_window = active_browser->window(); | 100 BrowserWindow* active_window = active_browser->window(); |
101 const views::Widget* current_window = GetWidget(); | 101 const views::Widget* current_window = GetWidget(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->current_input_method(); |
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 |