| 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 "ash/common/system/ime/tray_ime_chromeos.h" | 5 #include "ash/common/system/ime/tray_ime_chromeos.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/common/material_design/material_design_controller.h" | 9 #include "ash/common/material_design/material_design_controller.h" |
| 10 #include "ash/common/session/session_state_delegate.h" | 10 #include "ash/common/session/session_state_delegate.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 tray_label_->SetVisible(visible); | 262 tray_label_->SetVisible(visible); |
| 263 // Do not change label before hiding because this change is noticeable. | 263 // Do not change label before hiding because this change is noticeable. |
| 264 if (!visible) | 264 if (!visible) |
| 265 return; | 265 return; |
| 266 if (current.third_party) { | 266 if (current.third_party) { |
| 267 tray_label_->label()->SetText(current.short_name + | 267 tray_label_->label()->SetText(current.short_name + |
| 268 base::UTF8ToUTF16("*")); | 268 base::UTF8ToUTF16("*")); |
| 269 } else { | 269 } else { |
| 270 tray_label_->label()->SetText(current.short_name); | 270 tray_label_->label()->SetText(current.short_name); |
| 271 } | 271 } |
| 272 SetTrayLabelItemBorder(tray_label_, system_tray()->shelf_alignment()); | |
| 273 tray_label_->Layout(); | 272 tray_label_->Layout(); |
| 274 } | 273 } |
| 275 } | 274 } |
| 276 | 275 |
| 277 bool TrayIME::ShouldShowKeyboardToggle() { | 276 bool TrayIME::ShouldShowKeyboardToggle() { |
| 278 return keyboard_suppressed_ && !Shell::GetInstance() | 277 return keyboard_suppressed_ && !Shell::GetInstance() |
| 279 ->accessibility_delegate() | 278 ->accessibility_delegate() |
| 280 ->IsVirtualKeyboardEnabled(); | 279 ->IsVirtualKeyboardEnabled(); |
| 281 } | 280 } |
| 282 | 281 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 } | 325 } |
| 327 | 326 |
| 328 void TrayIME::DestroyDefaultView() { | 327 void TrayIME::DestroyDefaultView() { |
| 329 default_ = NULL; | 328 default_ = NULL; |
| 330 } | 329 } |
| 331 | 330 |
| 332 void TrayIME::DestroyDetailedView() { | 331 void TrayIME::DestroyDetailedView() { |
| 333 detailed_ = NULL; | 332 detailed_ = NULL; |
| 334 } | 333 } |
| 335 | 334 |
| 336 void TrayIME::UpdateAfterLoginStatusChange(LoginStatus status) {} | |
| 337 | |
| 338 void TrayIME::UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) { | |
| 339 SetTrayLabelItemBorder(tray_label_, alignment); | |
| 340 tray_label_->Layout(); | |
| 341 } | |
| 342 | |
| 343 void TrayIME::OnIMERefresh() { | 335 void TrayIME::OnIMERefresh() { |
| 344 // Caches the current ime state. | 336 // Caches the current ime state. |
| 345 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); | 337 SystemTrayDelegate* delegate = WmShell::Get()->system_tray_delegate(); |
| 346 ime_list_.clear(); | 338 ime_list_.clear(); |
| 347 property_list_.clear(); | 339 property_list_.clear(); |
| 348 delegate->GetCurrentIME(¤t_ime_); | 340 delegate->GetCurrentIME(¤t_ime_); |
| 349 delegate->GetAvailableIMEList(&ime_list_); | 341 delegate->GetAvailableIMEList(&ime_list_); |
| 350 delegate->GetCurrentIMEProperties(&property_list_); | 342 delegate->GetCurrentIMEProperties(&property_list_); |
| 351 ime_managed_message_ = delegate->GetIMEManagedMessage(); | 343 ime_managed_message_ = delegate->GetIMEManagedMessage(); |
| 352 | 344 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 378 return ime_count >= threshold; | 370 return ime_count >= threshold; |
| 379 } | 371 } |
| 380 | 372 |
| 381 ImeListView::SingleImeBehavior TrayIME::GetSingleImeBehavior() { | 373 ImeListView::SingleImeBehavior TrayIME::GetSingleImeBehavior() { |
| 382 // If managed, we also want to show a single IME. | 374 // If managed, we also want to show a single IME. |
| 383 return IsIMEManaged() ? ImeListView::SHOW_SINGLE_IME | 375 return IsIMEManaged() ? ImeListView::SHOW_SINGLE_IME |
| 384 : ImeListView::HIDE_SINGLE_IME; | 376 : ImeListView::HIDE_SINGLE_IME; |
| 385 } | 377 } |
| 386 | 378 |
| 387 } // namespace ash | 379 } // namespace ash |
| OLD | NEW |