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.h" | 5 #include "chrome/browser/chromeos/status/input_method_menu.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 InputMethodManager::GetInstance()->SetImePropertyActivated( | 378 InputMethodManager::GetInstance()->SetImePropertyActivated( |
379 key, false); | 379 key, false); |
380 } | 380 } |
381 return; | 381 return; |
382 } | 382 } |
383 | 383 |
384 LOG(ERROR) << "Unexpected index: " << index; | 384 LOG(ERROR) << "Unexpected index: " << index; |
385 } | 385 } |
386 | 386 |
387 //////////////////////////////////////////////////////////////////////////////// | 387 //////////////////////////////////////////////////////////////////////////////// |
388 // views::MenuButtonDelegate implementation: | 388 // views::MenuButtonListener implementation: |
389 | 389 |
390 void InputMethodMenu::RunMenu(views::View* source, const gfx::Point& pt) { | 390 void InputMethodMenu::OnMenuButtonClicked(views::View* source, |
| 391 const gfx::Point& point) { |
391 PrepareForMenuOpen(); | 392 PrepareForMenuOpen(); |
392 | 393 |
393 if (minimum_input_method_menu_width_ > 0) { | 394 if (minimum_input_method_menu_width_ > 0) { |
394 DCHECK(input_method_menu_->HasSubmenu()); | 395 DCHECK(input_method_menu_->HasSubmenu()); |
395 views::SubmenuView* submenu = input_method_menu_->GetSubmenu(); | 396 views::SubmenuView* submenu = input_method_menu_->GetSubmenu(); |
396 submenu->set_minimum_preferred_width(minimum_input_method_menu_width_); | 397 submenu->set_minimum_preferred_width(minimum_input_method_menu_width_); |
397 } | 398 } |
398 | 399 |
399 gfx::Point screen_location; | 400 gfx::Point screen_location; |
400 views::View::ConvertPointToScreen(source, &screen_location); | 401 views::View::ConvertPointToScreen(source, &screen_location); |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 if (!initialized_prefs_) { | 745 if (!initialized_prefs_) { |
745 initialized_prefs_ = true; | 746 initialized_prefs_ = true; |
746 previous_input_method_pref_.Init( | 747 previous_input_method_pref_.Init( |
747 prefs::kLanguagePreviousInputMethod, pref_service_, this); | 748 prefs::kLanguagePreviousInputMethod, pref_service_, this); |
748 current_input_method_pref_.Init( | 749 current_input_method_pref_.Init( |
749 prefs::kLanguageCurrentInputMethod, pref_service_, this); | 750 prefs::kLanguageCurrentInputMethod, pref_service_, this); |
750 } | 751 } |
751 } | 752 } |
752 | 753 |
753 } // namespace chromeos | 754 } // namespace chromeos |
OLD | NEW |