| 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/system/ime/tray_ime_chromeos.h" | 5 #include "ash/system/ime/tray_ime_chromeos.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "ash/common/session/session_state_delegate.h" | 9 #include "ash/common/session/session_state_delegate.h" |
| 10 #include "ash/common/system/tray/hover_highlight_view.h" | 10 #include "ash/common/system/tray/hover_highlight_view.h" |
| 11 #include "ash/common/system/tray/system_tray_delegate.h" | 11 #include "ash/common/system/tray/system_tray_delegate.h" |
| 12 #include "ash/common/system/tray/tray_constants.h" | 12 #include "ash/common/system/tray/tray_constants.h" |
| 13 #include "ash/common/system/tray/tray_item_more.h" | 13 #include "ash/common/system/tray/tray_item_more.h" |
| 14 #include "ash/common/system/tray/tray_item_view.h" | 14 #include "ash/common/system/tray/tray_item_view.h" |
| 15 #include "ash/common/system/tray/tray_utils.h" | 15 #include "ash/common/system/tray/tray_utils.h" |
| 16 #include "ash/common/system/tray/wm_system_tray_notifier.h" |
| 16 #include "ash/common/wm_shell.h" | 17 #include "ash/common/wm_shell.h" |
| 17 #include "ash/metrics/user_metrics_recorder.h" | 18 #include "ash/metrics/user_metrics_recorder.h" |
| 18 #include "ash/root_window_controller.h" | 19 #include "ash/root_window_controller.h" |
| 19 #include "ash/shell.h" | 20 #include "ash/shell.h" |
| 20 #include "ash/system/tray/system_tray.h" | 21 #include "ash/system/tray/system_tray.h" |
| 21 #include "ash/system/tray/system_tray_notifier.h" | 22 #include "ash/system/tray/system_tray_notifier.h" |
| 22 #include "ash/system/tray/tray_details_view.h" | 23 #include "ash/system/tray/tray_details_view.h" |
| 23 #include "ash/system/tray_accessibility.h" | 24 #include "ash/system/tray_accessibility.h" |
| 24 #include "ash/virtual_keyboard_controller.h" | 25 #include "ash/virtual_keyboard_controller.h" |
| 25 #include "base/logging.h" | 26 #include "base/logging.h" |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 TrayIME::TrayIME(SystemTray* system_tray) | 235 TrayIME::TrayIME(SystemTray* system_tray) |
| 235 : SystemTrayItem(system_tray), | 236 : SystemTrayItem(system_tray), |
| 236 tray_label_(NULL), | 237 tray_label_(NULL), |
| 237 default_(NULL), | 238 default_(NULL), |
| 238 detailed_(NULL), | 239 detailed_(NULL), |
| 239 keyboard_suppressed_(false), | 240 keyboard_suppressed_(false), |
| 240 is_visible_(true) { | 241 is_visible_(true) { |
| 241 Shell::GetInstance()->system_tray_notifier()->AddIMEObserver(this); | 242 Shell::GetInstance()->system_tray_notifier()->AddIMEObserver(this); |
| 242 Shell::GetInstance()->system_tray_notifier()->AddVirtualKeyboardObserver( | 243 Shell::GetInstance()->system_tray_notifier()->AddVirtualKeyboardObserver( |
| 243 this); | 244 this); |
| 244 Shell::GetInstance()->system_tray_notifier()->AddAccessibilityObserver(this); | 245 WmShell::Get()->system_tray_notifier()->AddAccessibilityObserver(this); |
| 245 } | 246 } |
| 246 | 247 |
| 247 TrayIME::~TrayIME() { | 248 TrayIME::~TrayIME() { |
| 248 Shell::GetInstance()->system_tray_notifier()->RemoveIMEObserver(this); | 249 Shell::GetInstance()->system_tray_notifier()->RemoveIMEObserver(this); |
| 249 Shell::GetInstance()->system_tray_notifier()->RemoveAccessibilityObserver( | 250 WmShell::Get()->system_tray_notifier()->RemoveAccessibilityObserver(this); |
| 250 this); | |
| 251 Shell::GetInstance()->system_tray_notifier()->RemoveVirtualKeyboardObserver( | 251 Shell::GetInstance()->system_tray_notifier()->RemoveVirtualKeyboardObserver( |
| 252 this); | 252 this); |
| 253 } | 253 } |
| 254 | 254 |
| 255 void TrayIME::OnKeyboardSuppressionChanged(bool suppressed) { | 255 void TrayIME::OnKeyboardSuppressionChanged(bool suppressed) { |
| 256 keyboard_suppressed_ = suppressed; | 256 keyboard_suppressed_ = suppressed; |
| 257 Update(); | 257 Update(); |
| 258 } | 258 } |
| 259 | 259 |
| 260 void TrayIME::OnAccessibilityModeChanged( | 260 void TrayIME::OnAccessibilityModeChanged( |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 else | 375 else |
| 376 Update(); | 376 Update(); |
| 377 } | 377 } |
| 378 | 378 |
| 379 bool TrayIME::ShouldDefaultViewBeVisible() { | 379 bool TrayIME::ShouldDefaultViewBeVisible() { |
| 380 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || | 380 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || |
| 381 ShouldShowKeyboardToggle()); | 381 ShouldShowKeyboardToggle()); |
| 382 } | 382 } |
| 383 | 383 |
| 384 } // namespace ash | 384 } // namespace ash |
| OLD | NEW |