| 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/resources/vector_icons/vector_icons.h" | 9 #include "ash/resources/vector_icons/vector_icons.h" |
| 10 #include "ash/session/session_state_delegate.h" | 10 #include "ash/session/session_state_delegate.h" |
| 11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
| 12 #include "ash/shell_port.h" |
| 12 #include "ash/strings/grit/ash_strings.h" | 13 #include "ash/strings/grit/ash_strings.h" |
| 13 #include "ash/system/tray/system_tray.h" | 14 #include "ash/system/tray/system_tray.h" |
| 14 #include "ash/system/tray/system_tray_controller.h" | 15 #include "ash/system/tray/system_tray_controller.h" |
| 15 #include "ash/system/tray/system_tray_delegate.h" | 16 #include "ash/system/tray/system_tray_delegate.h" |
| 16 #include "ash/system/tray/system_tray_notifier.h" | 17 #include "ash/system/tray/system_tray_notifier.h" |
| 17 #include "ash/system/tray/tray_constants.h" | 18 #include "ash/system/tray/tray_constants.h" |
| 18 #include "ash/system/tray/tray_details_view.h" | 19 #include "ash/system/tray/tray_details_view.h" |
| 19 #include "ash/system/tray/tray_item_more.h" | 20 #include "ash/system/tray/tray_item_more.h" |
| 20 #include "ash/system/tray/tray_item_view.h" | 21 #include "ash/system/tray/tray_item_view.h" |
| 21 #include "ash/system/tray/tray_popup_item_style.h" | 22 #include "ash/system/tray/tray_popup_item_style.h" |
| 22 #include "ash/system/tray/tray_popup_utils.h" | 23 #include "ash/system/tray/tray_popup_utils.h" |
| 23 #include "ash/system/tray/tray_utils.h" | 24 #include "ash/system/tray/tray_utils.h" |
| 24 #include "ash/system/tray/tri_view.h" | 25 #include "ash/system/tray/tri_view.h" |
| 25 #include "ash/system/tray_accessibility.h" | 26 #include "ash/system/tray_accessibility.h" |
| 26 #include "ash/wm_shell.h" | |
| 27 #include "base/logging.h" | 27 #include "base/logging.h" |
| 28 #include "base/strings/utf_string_conversions.h" | 28 #include "base/strings/utf_string_conversions.h" |
| 29 #include "ui/accessibility/ax_enums.h" | 29 #include "ui/accessibility/ax_enums.h" |
| 30 #include "ui/accessibility/ax_node_data.h" | 30 #include "ui/accessibility/ax_node_data.h" |
| 31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
| 32 #include "ui/gfx/font.h" | 32 #include "ui/gfx/font.h" |
| 33 #include "ui/gfx/image/image.h" | 33 #include "ui/gfx/image/image.h" |
| 34 #include "ui/gfx/paint_vector_icon.h" | 34 #include "ui/gfx/paint_vector_icon.h" |
| 35 #include "ui/keyboard/keyboard_util.h" | 35 #include "ui/keyboard/keyboard_util.h" |
| 36 #include "ui/views/controls/image_view.h" | 36 #include "ui/views/controls/image_view.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 tri_view()->AddView(TriView::Container::END, controlled_setting_icon_); | 117 tri_view()->AddView(TriView::Container::END, controlled_setting_icon_); |
| 118 } | 118 } |
| 119 | 119 |
| 120 tri_view()->SetContainerVisible(TriView::Container::END, true); | 120 tri_view()->SetContainerVisible(TriView::Container::END, true); |
| 121 settings_button_ = | 121 settings_button_ = |
| 122 CreateSettingsButton(login_, IDS_ASH_STATUS_TRAY_IME_SETTINGS); | 122 CreateSettingsButton(login_, IDS_ASH_STATUS_TRAY_IME_SETTINGS); |
| 123 tri_view()->AddView(TriView::Container::END, settings_button_); | 123 tri_view()->AddView(TriView::Container::END, settings_button_); |
| 124 } | 124 } |
| 125 | 125 |
| 126 void ShowSettings() { | 126 void ShowSettings() { |
| 127 WmShell::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_IME_SHOW_DETAILED); | 127 ShellPort::Get()->RecordUserMetricsAction( |
| 128 UMA_STATUS_AREA_IME_SHOW_DETAILED); |
| 128 Shell::Get()->system_tray_controller()->ShowIMESettings(); | 129 Shell::Get()->system_tray_controller()->ShowIMESettings(); |
| 129 if (owner()->system_tray()) | 130 if (owner()->system_tray()) |
| 130 owner()->system_tray()->CloseSystemBubble(); | 131 owner()->system_tray()->CloseSystemBubble(); |
| 131 } | 132 } |
| 132 | 133 |
| 133 LoginStatus login_; | 134 LoginStatus login_; |
| 134 | 135 |
| 135 views::Button* settings_button_; | 136 views::Button* settings_button_; |
| 136 | 137 |
| 137 // This icon says that the IMEs are managed by policy. | 138 // This icon says that the IMEs are managed by policy. |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 return ime_count >= threshold; | 302 return ime_count >= threshold; |
| 302 } | 303 } |
| 303 | 304 |
| 304 ImeListView::SingleImeBehavior TrayIME::GetSingleImeBehavior() { | 305 ImeListView::SingleImeBehavior TrayIME::GetSingleImeBehavior() { |
| 305 // If managed, we also want to show a single IME. | 306 // If managed, we also want to show a single IME. |
| 306 return IsIMEManaged() ? ImeListView::SHOW_SINGLE_IME | 307 return IsIMEManaged() ? ImeListView::SHOW_SINGLE_IME |
| 307 : ImeListView::HIDE_SINGLE_IME; | 308 : ImeListView::HIDE_SINGLE_IME; |
| 308 } | 309 } |
| 309 | 310 |
| 310 } // namespace ash | 311 } // namespace ash |
| OLD | NEW |