| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 328 std::string current = manager->GetCurrentInputMethod().id(); | 328 std::string current = manager->GetCurrentInputMethod().id(); |
| 329 for (size_t i = 0; i < ime_descriptors->size(); i++) { | 329 for (size_t i = 0; i < ime_descriptors->size(); i++) { |
| 330 input_method::InputMethodDescriptor& ime = ime_descriptors->at(i); | 330 input_method::InputMethodDescriptor& ime = ime_descriptors->at(i); |
| 331 ash::IMEInfo info; | 331 ash::IMEInfo info; |
| 332 ExtractIMEInfo(ime, *util, &info); | 332 ExtractIMEInfo(ime, *util, &info); |
| 333 info.selected = ime.id() == current; | 333 info.selected = ime.id() == current; |
| 334 list->push_back(info); | 334 list->push_back(info); |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 | 337 |
| 338 virtual void GetCurrentIMEProperties( |
| 339 ash::IMEPropertyInfoList* list) OVERRIDE { |
| 340 input_method::InputMethodManager* manager = |
| 341 input_method::InputMethodManager::GetInstance(); |
| 342 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); |
| 343 input_method::InputMethodPropertyList properties = |
| 344 manager->GetCurrentInputMethodProperties(); |
| 345 for (size_t i = 0; i < properties.size(); ++i) { |
| 346 ash::IMEPropertyInfo property; |
| 347 // Do not show the item not in the selection item. |
| 348 if (!properties[i].is_selection_item) |
| 349 continue; |
| 350 property.key = properties[i].key; |
| 351 property.name = util->TranslateString(properties[i].label); |
| 352 property.selected = properties[i].is_selection_item_checked; |
| 353 list->push_back(property); |
| 354 } |
| 355 } |
| 356 |
| 338 virtual void SwitchIME(const std::string& ime_id) OVERRIDE { | 357 virtual void SwitchIME(const std::string& ime_id) OVERRIDE { |
| 339 input_method::InputMethodManager::GetInstance()->ChangeInputMethod(ime_id); | 358 input_method::InputMethodManager::GetInstance()->ChangeInputMethod(ime_id); |
| 340 } | 359 } |
| 341 | 360 |
| 361 virtual void ActivateIMEProperty(const std::string& key) OVERRIDE { |
| 362 input_method::InputMethodManager::GetInstance()->SetImePropertyActivated( |
| 363 key, true); |
| 364 } |
| 365 |
| 342 virtual void GetMostRelevantNetworkIcon(ash::NetworkIconInfo* info, | 366 virtual void GetMostRelevantNetworkIcon(ash::NetworkIconInfo* info, |
| 343 bool large) OVERRIDE { | 367 bool large) OVERRIDE { |
| 344 info->image = !large ? network_icon_->GetIconAndText(&info->description) : | 368 info->image = !large ? network_icon_->GetIconAndText(&info->description) : |
| 345 network_icon_large_->GetIconAndText(&info->description); | 369 network_icon_large_->GetIconAndText(&info->description); |
| 346 } | 370 } |
| 347 | 371 |
| 348 virtual void GetAvailableNetworks( | 372 virtual void GetAvailableNetworks( |
| 349 std::vector<ash::NetworkIconInfo>* list) OVERRIDE { | 373 std::vector<ash::NetworkIconInfo>* list) OVERRIDE { |
| 350 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); | 374 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); |
| 351 | 375 |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 772 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 796 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
| 773 }; | 797 }; |
| 774 | 798 |
| 775 } // namespace | 799 } // namespace |
| 776 | 800 |
| 777 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 801 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
| 778 return new chromeos::SystemTrayDelegate(tray); | 802 return new chromeos::SystemTrayDelegate(tray); |
| 779 } | 803 } |
| 780 | 804 |
| 781 } // namespace chromeos | 805 } // namespace chromeos |
| OLD | NEW |