| 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/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/system_tray_notifier.h" |
| 12 #include "ash/common/system/tray/tray_constants.h" | 13 #include "ash/common/system/tray/tray_constants.h" |
| 13 #include "ash/common/system/tray/tray_details_view.h" | 14 #include "ash/common/system/tray/tray_details_view.h" |
| 14 #include "ash/common/system/tray/tray_item_more.h" | 15 #include "ash/common/system/tray/tray_item_more.h" |
| 15 #include "ash/common/system/tray/tray_item_view.h" | 16 #include "ash/common/system/tray/tray_item_view.h" |
| 16 #include "ash/common/system/tray/tray_utils.h" | 17 #include "ash/common/system/tray/tray_utils.h" |
| 17 #include "ash/common/system/tray/wm_system_tray_notifier.h" | |
| 18 #include "ash/common/system/tray_accessibility.h" | 18 #include "ash/common/system/tray_accessibility.h" |
| 19 #include "ash/common/wm_shell.h" | 19 #include "ash/common/wm_shell.h" |
| 20 #include "ash/system/tray/system_tray.h" | 20 #include "ash/system/tray/system_tray.h" |
| 21 #include "base/logging.h" | 21 #include "base/logging.h" |
| 22 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
| 23 #include "grit/ash_resources.h" | 23 #include "grit/ash_resources.h" |
| 24 #include "grit/ash_strings.h" | 24 #include "grit/ash_strings.h" |
| 25 #include "ui/accessibility/ax_enums.h" | 25 #include "ui/accessibility/ax_enums.h" |
| 26 #include "ui/accessibility/ax_view_state.h" | 26 #include "ui/accessibility/ax_view_state.h" |
| 27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 } // namespace tray | 224 } // namespace tray |
| 225 | 225 |
| 226 TrayIME::TrayIME(SystemTray* system_tray) | 226 TrayIME::TrayIME(SystemTray* system_tray) |
| 227 : SystemTrayItem(system_tray), | 227 : SystemTrayItem(system_tray), |
| 228 tray_label_(NULL), | 228 tray_label_(NULL), |
| 229 default_(NULL), | 229 default_(NULL), |
| 230 detailed_(NULL), | 230 detailed_(NULL), |
| 231 keyboard_suppressed_(false), | 231 keyboard_suppressed_(false), |
| 232 is_visible_(true) { | 232 is_visible_(true) { |
| 233 WmSystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); | 233 SystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); |
| 234 tray_notifier->AddVirtualKeyboardObserver(this); | 234 tray_notifier->AddVirtualKeyboardObserver(this); |
| 235 tray_notifier->AddAccessibilityObserver(this); | 235 tray_notifier->AddAccessibilityObserver(this); |
| 236 tray_notifier->AddIMEObserver(this); | 236 tray_notifier->AddIMEObserver(this); |
| 237 } | 237 } |
| 238 | 238 |
| 239 TrayIME::~TrayIME() { | 239 TrayIME::~TrayIME() { |
| 240 WmSystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); | 240 SystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); |
| 241 tray_notifier->RemoveIMEObserver(this); | 241 tray_notifier->RemoveIMEObserver(this); |
| 242 tray_notifier->RemoveAccessibilityObserver(this); | 242 tray_notifier->RemoveAccessibilityObserver(this); |
| 243 tray_notifier->RemoveVirtualKeyboardObserver(this); | 243 tray_notifier->RemoveVirtualKeyboardObserver(this); |
| 244 } | 244 } |
| 245 | 245 |
| 246 void TrayIME::OnKeyboardSuppressionChanged(bool suppressed) { | 246 void TrayIME::OnKeyboardSuppressionChanged(bool suppressed) { |
| 247 keyboard_suppressed_ = suppressed; | 247 keyboard_suppressed_ = suppressed; |
| 248 Update(); | 248 Update(); |
| 249 } | 249 } |
| 250 | 250 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 else | 366 else |
| 367 Update(); | 367 Update(); |
| 368 } | 368 } |
| 369 | 369 |
| 370 bool TrayIME::ShouldDefaultViewBeVisible() { | 370 bool TrayIME::ShouldDefaultViewBeVisible() { |
| 371 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || | 371 return is_visible_ && (ime_list_.size() > 1 || property_list_.size() > 1 || |
| 372 ShouldShowKeyboardToggle()); | 372 ShouldShowKeyboardToggle()); |
| 373 } | 373 } |
| 374 | 374 |
| 375 } // namespace ash | 375 } // namespace ash |
| OLD | NEW |