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 | 369 |
370 virtual void GetCurrentIMEProperties( | 370 virtual void GetCurrentIMEProperties( |
371 ash::IMEPropertyInfoList* list) OVERRIDE { | 371 ash::IMEPropertyInfoList* list) OVERRIDE { |
372 input_method::InputMethodManager* manager = | 372 input_method::InputMethodManager* manager = |
373 input_method::InputMethodManager::GetInstance(); | 373 input_method::InputMethodManager::GetInstance(); |
374 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); | 374 input_method::InputMethodUtil* util = manager->GetInputMethodUtil(); |
375 input_method::InputMethodPropertyList properties = | 375 input_method::InputMethodPropertyList properties = |
376 manager->GetCurrentInputMethodProperties(); | 376 manager->GetCurrentInputMethodProperties(); |
377 for (size_t i = 0; i < properties.size(); ++i) { | 377 for (size_t i = 0; i < properties.size(); ++i) { |
378 ash::IMEPropertyInfo property; | 378 ash::IMEPropertyInfo property; |
379 // Do not show the item not in the selection item. | |
380 if (!properties[i].is_selection_item) | |
381 continue; | |
382 property.key = properties[i].key; | 379 property.key = properties[i].key; |
383 property.name = util->TranslateString(properties[i].label); | 380 property.name = util->TranslateString(properties[i].label); |
384 property.selected = properties[i].is_selection_item_checked; | 381 property.selected = properties[i].is_selection_item_checked; |
| 382 property.is_selection = properties[i].is_selection_item; |
385 list->push_back(property); | 383 list->push_back(property); |
386 } | 384 } |
387 } | 385 } |
388 | 386 |
389 virtual void SwitchIME(const std::string& ime_id) OVERRIDE { | 387 virtual void SwitchIME(const std::string& ime_id) OVERRIDE { |
390 input_method::InputMethodManager::GetInstance()->ChangeInputMethod(ime_id); | 388 input_method::InputMethodManager::GetInstance()->ChangeInputMethod(ime_id); |
391 } | 389 } |
392 | 390 |
393 virtual void ActivateIMEProperty(const std::string& key) OVERRIDE { | 391 virtual void ActivateIMEProperty( |
| 392 const std::string& key, bool is_selection) OVERRIDE { |
394 input_method::InputMethodManager::GetInstance()->SetImePropertyActivated( | 393 input_method::InputMethodManager::GetInstance()->SetImePropertyActivated( |
395 key, true); | 394 key, is_selection); |
396 } | 395 } |
397 | 396 |
398 virtual void GetMostRelevantNetworkIcon(ash::NetworkIconInfo* info, | 397 virtual void GetMostRelevantNetworkIcon(ash::NetworkIconInfo* info, |
399 bool dark) OVERRIDE { | 398 bool dark) OVERRIDE { |
400 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); | 399 NetworkLibrary* crosnet = CrosLibrary::Get()->GetNetworkLibrary(); |
401 info->image = !dark ? network_icon_->GetIconAndText(&info->description) : | 400 info->image = !dark ? network_icon_->GetIconAndText(&info->description) : |
402 network_icon_dark_->GetIconAndText(&info->description); | 401 network_icon_dark_->GetIconAndText(&info->description); |
403 info->tray_icon_visible = | 402 info->tray_icon_visible = |
404 ShouldShowNetworkIconInTray(crosnet->connected_network()); | 403 ShouldShowNetworkIconInTray(crosnet->connected_network()); |
405 } | 404 } |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); | 968 DISALLOW_COPY_AND_ASSIGN(SystemTrayDelegate); |
970 }; | 969 }; |
971 | 970 |
972 } // namespace | 971 } // namespace |
973 | 972 |
974 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { | 973 ash::SystemTrayDelegate* CreateSystemTrayDelegate(ash::SystemTray* tray) { |
975 return new chromeos::SystemTrayDelegate(tray); | 974 return new chromeos::SystemTrayDelegate(tray); |
976 } | 975 } |
977 | 976 |
978 } // namespace chromeos | 977 } // namespace chromeos |
OLD | NEW |