Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(251)

Side by Side Diff: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc

Issue 419293002: IME refactoring: ChromeOS introduce input methods State. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit test fixed. Re-sorted methods of StateImpl and IMM. Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/ui/ash/system_tray_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after
687 } 687 }
688 688
689 bool SystemTrayDelegateChromeOS::IsBluetoothDiscovering() { 689 bool SystemTrayDelegateChromeOS::IsBluetoothDiscovering() {
690 return bluetooth_adapter_->IsDiscovering(); 690 return bluetooth_adapter_->IsDiscovering();
691 } 691 }
692 692
693 void SystemTrayDelegateChromeOS::GetCurrentIME(ash::IMEInfo* info) { 693 void SystemTrayDelegateChromeOS::GetCurrentIME(ash::IMEInfo* info) {
694 input_method::InputMethodManager* manager = 694 input_method::InputMethodManager* manager =
695 input_method::InputMethodManager::Get(); 695 input_method::InputMethodManager::Get();
696 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); 696 input_method::InputMethodUtil* util = manager->GetInputMethodUtil();
697 input_method::InputMethodDescriptor ime = manager->GetCurrentInputMethod(); 697 input_method::InputMethodDescriptor ime =
698 manager->GetActiveIMEState()->GetCurrentInputMethod();
698 ExtractIMEInfo(ime, *util, info); 699 ExtractIMEInfo(ime, *util, info);
699 info->selected = true; 700 info->selected = true;
700 } 701 }
701 702
702 void SystemTrayDelegateChromeOS::GetAvailableIMEList(ash::IMEInfoList* list) { 703 void SystemTrayDelegateChromeOS::GetAvailableIMEList(ash::IMEInfoList* list) {
703 input_method::InputMethodManager* manager = 704 input_method::InputMethodManager* manager =
704 input_method::InputMethodManager::Get(); 705 input_method::InputMethodManager::Get();
705 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); 706 input_method::InputMethodUtil* util = manager->GetInputMethodUtil();
706 scoped_ptr<input_method::InputMethodDescriptors> ime_descriptors( 707 scoped_ptr<input_method::InputMethodDescriptors> ime_descriptors(
707 manager->GetActiveInputMethods()); 708 manager->GetActiveIMEState()->GetActiveInputMethods());
708 std::string current = manager->GetCurrentInputMethod().id(); 709 std::string current =
710 manager->GetActiveIMEState()->GetCurrentInputMethod().id();
709 for (size_t i = 0; i < ime_descriptors->size(); i++) { 711 for (size_t i = 0; i < ime_descriptors->size(); i++) {
710 input_method::InputMethodDescriptor& ime = ime_descriptors->at(i); 712 input_method::InputMethodDescriptor& ime = ime_descriptors->at(i);
711 ash::IMEInfo info; 713 ash::IMEInfo info;
712 ExtractIMEInfo(ime, *util, &info); 714 ExtractIMEInfo(ime, *util, &info);
713 info.selected = ime.id() == current; 715 info.selected = ime.id() == current;
714 list->push_back(info); 716 list->push_back(info);
715 } 717 }
716 } 718 }
717 719
718 void SystemTrayDelegateChromeOS::GetCurrentIMEProperties( 720 void SystemTrayDelegateChromeOS::GetCurrentIMEProperties(
719 ash::IMEPropertyInfoList* list) { 721 ash::IMEPropertyInfoList* list) {
720 ash::ime::InputMethodMenuItemList menu_list = 722 ash::ime::InputMethodMenuItemList menu_list =
721 ash::ime::InputMethodMenuManager::GetInstance()-> 723 ash::ime::InputMethodMenuManager::GetInstance()->
722 GetCurrentInputMethodMenuItemList(); 724 GetCurrentInputMethodMenuItemList();
723 for (size_t i = 0; i < menu_list.size(); ++i) { 725 for (size_t i = 0; i < menu_list.size(); ++i) {
724 ash::IMEPropertyInfo property; 726 ash::IMEPropertyInfo property;
725 property.key = menu_list[i].key; 727 property.key = menu_list[i].key;
726 property.name = base::UTF8ToUTF16(menu_list[i].label); 728 property.name = base::UTF8ToUTF16(menu_list[i].label);
727 property.selected = menu_list[i].is_selection_item_checked; 729 property.selected = menu_list[i].is_selection_item_checked;
728 list->push_back(property); 730 list->push_back(property);
729 } 731 }
730 } 732 }
731 733
732 void SystemTrayDelegateChromeOS::SwitchIME(const std::string& ime_id) { 734 void SystemTrayDelegateChromeOS::SwitchIME(const std::string& ime_id) {
733 input_method::InputMethodManager::Get()->ChangeInputMethod(ime_id); 735 input_method::InputMethodManager::Get()
736 ->GetActiveIMEState()
737 ->ChangeInputMethod(ime_id, false /* show_message */);
734 } 738 }
735 739
736 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { 740 void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) {
737 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); 741 input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key);
738 } 742 }
739 743
740 void SystemTrayDelegateChromeOS::ShowNetworkConfigure( 744 void SystemTrayDelegateChromeOS::ShowNetworkConfigure(
741 const std::string& network_id, 745 const std::string& network_id,
742 gfx::NativeWindow parent_window) { 746 gfx::NativeWindow parent_window) {
743 NetworkConfigView::Show(network_id, parent_window); 747 NetworkConfigView::Show(network_id, parent_window);
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
1288 accessibility_subscription_.reset(); 1292 accessibility_subscription_.reset();
1289 else 1293 else
1290 OnAccessibilityModeChanged(details.notify); 1294 OnAccessibilityModeChanged(details.notify);
1291 } 1295 }
1292 1296
1293 ash::SystemTrayDelegate* CreateSystemTrayDelegate() { 1297 ash::SystemTrayDelegate* CreateSystemTrayDelegate() {
1294 return new SystemTrayDelegateChromeOS(); 1298 return new SystemTrayDelegateChromeOS();
1295 } 1299 }
1296 1300
1297 } // namespace chromeos 1301 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/ime_controller_chromeos.cc ('k') | chrome/browser/ui/webui/chromeos/keyboard_overlay_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698