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/system/ash_system_tray_delegate.h" | 5 #include "chrome/browser/chromeos/system/ash_system_tray_delegate.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "ash/system/audio/audio_observer.h" | 9 #include "ash/system/audio/audio_observer.h" |
10 #include "ash/system/bluetooth/bluetooth_observer.h" | 10 #include "ash/system/bluetooth/bluetooth_observer.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 input_method::InputMethodManager* manager = | 369 input_method::InputMethodManager* manager = |
370 input_method::InputMethodManager::GetInstance(); | 370 input_method::InputMethodManager::GetInstance(); |
371 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); | 371 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); |
372 input_method::InputMethodPropertyList properties = | 372 input_method::InputMethodPropertyList properties = |
373 manager->GetCurrentInputMethodProperties(); | 373 manager->GetCurrentInputMethodProperties(); |
374 for (size_t i = 0; i < properties.size(); ++i) { | 374 for (size_t i = 0; i < properties.size(); ++i) { |
375 ash::IMEPropertyInfo property; | 375 ash::IMEPropertyInfo property; |
376 property.key = properties[i].key; | 376 property.key = properties[i].key; |
377 property.name = util->TranslateString(properties[i].label); | 377 property.name = util->TranslateString(properties[i].label); |
378 property.selected = properties[i].is_selection_item_checked; | 378 property.selected = properties[i].is_selection_item_checked; |
379 property.is_selection = properties[i].is_selection_item; | |
380 list->push_back(property); | 379 list->push_back(property); |
381 } | 380 } |
382 } | 381 } |
383 | 382 |
384 virtual void SwitchIME(const std::string& ime_id) OVERRIDE { | 383 virtual void SwitchIME(const std::string& ime_id) OVERRIDE { |
385 input_method::InputMethodManager::GetInstance()->ChangeInputMethod(ime_id); | 384 input_method::InputMethodManager::GetInstance()->ChangeInputMethod(ime_id); |
386 } | 385 } |
387 | 386 |
388 virtual void ActivateIMEProperty( | 387 virtual void ActivateIMEProperty(const std::string& key) OVERRIDE { |
389 const std::string& key, bool is_selection) OVERRIDE { | 388 input_method::InputMethodManager::GetInstance()-> |
390 input_method::InputMethodManager::GetInstance()->SetImePropertyActivated( | 389 ActivateInputMethodProperty(key); |
391 key, is_selection); | |
392 } | 390 } |
393 | 391 |
394 virtual void GetMostRelevantNetworkIcon(ash::NetworkIconInfo* info, | 392 virtual void GetMostRelevantNetworkIcon(ash::NetworkIconInfo* info, |
395 bool dark) OVERRIDE { | 393 bool dark) OVERRIDE { |
396 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); | 394 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); |
397 info->image = !dark ? network_icon_->GetIconAndText(&info->description) : | 395 info->image = !dark ? network_icon_->GetIconAndText(&info->description) : |
398 network_icon_dark_->GetIconAndText(&info->description); | 396 network_icon_dark_->GetIconAndText(&info->description); |
399 info->tray_icon_visible = | 397 info->tray_icon_visible = |
400 ShouldShowNetworkIconInTray(crosnet->connected_network()); | 398 ShouldShowNetworkIconInTray(crosnet->connected_network()); |
401 } | 399 } |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
823 SetProfile(ProfileManager::GetDefaultProfile()); | 821 SetProfile(ProfileManager::GetDefaultProfile()); |
824 break; | 822 break; |
825 } | 823 } |
826 default: | 824 default: |
827 NOTREACHED(); | 825 NOTREACHED(); |
828 } | 826 } |
829 } | 827 } |
830 | 828 |
831 // Overridden from InputMethodManager::Observer. | 829 // Overridden from InputMethodManager::Observer. |
832 virtual void InputMethodChanged( | 830 virtual void InputMethodChanged( |
833 input_method::InputMethodManager* manager, | 831 input_method::InputMethodManager* manager) OVERRIDE { |
834 const input_method::InputMethodDescriptor& current_method, | |
835 size_t num_active_input_methods) OVERRIDE { | |
836 NotifyRefreshIME(); | 832 NotifyRefreshIME(); |
837 } | 833 } |
838 | 834 |
839 virtual void ActiveInputMethodsChanged( | 835 virtual void InputMethodPropertyChanged( |
840 input_method::InputMethodManager* manager, | 836 input_method::InputMethodManager* manager) OVERRIDE { |
841 const input_method::InputMethodDescriptor& current_input_method, | |
842 size_t num_active_input_methods) OVERRIDE { | |
843 NotifyRefreshIME(); | 837 NotifyRefreshIME(); |
844 } | 838 } |
845 | 839 |
846 virtual void PropertyListChanged( | |
847 input_method::InputMethodManager* manager, | |
848 const input_method::InputMethodPropertyList& properties) OVERRIDE { | |
849 NotifyRefreshIME(); | |
850 } | |
851 | |
852 // Overridden from system::TimezoneSettings::Observer. | 840 // Overridden from system::TimezoneSettings::Observer. |
853 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE { | 841 virtual void TimezoneChanged(const icu::TimeZone& timezone) OVERRIDE { |
854 NotifyRefreshClock(); | 842 NotifyRefreshClock(); |
855 } | 843 } |
856 | 844 |
857 // Overridden from BluetoothAdapter::Observer. | 845 // Overridden from BluetoothAdapter::Observer. |
858 virtual void AdapterPresentChanged(BluetoothAdapter* adapter, | 846 virtual void AdapterPresentChanged(BluetoothAdapter* adapter, |
859 bool present) OVERRIDE { | 847 bool present) OVERRIDE { |
860 NotifyRefreshBluetooth(); | 848 NotifyRefreshBluetooth(); |
861 } | 849 } |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 943 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
956 }; | 944 }; |
957 | 945 |
958 } // namespace | 946 } // namespace |
959 | 947 |
960 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 948 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
961 return new chromeos::SystemTrayDelegate(tray); | 949 return new chromeos::SystemTrayDelegate(tray); |
962 } | 950 } |
963 | 951 |
964 } // namespace chromeos | 952 } // namespace chromeos |
OLD | NEW |