| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/chromeos/ime_menu/ime_menu_tray.h" | 5 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" |
| 6 | 6 |
| 7 #include "ash/common/accessibility_delegate.h" | 7 #include "ash/common/accessibility_delegate.h" |
| 8 #include "ash/common/ash_constants.h" | 8 #include "ash/common/ash_constants.h" |
| 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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 DISALLOW_COPY_AND_ASSIGN(ImeButtonsView); | 300 DISALLOW_COPY_AND_ASSIGN(ImeButtonsView); |
| 301 }; | 301 }; |
| 302 | 302 |
| 303 // The list view that contains the selected IME and property items. | 303 // The list view that contains the selected IME and property items. |
| 304 class ImeMenuListView : public ImeListView { | 304 class ImeMenuListView : public ImeListView { |
| 305 public: | 305 public: |
| 306 ImeMenuListView(SystemTrayItem* owner, | 306 ImeMenuListView(SystemTrayItem* owner, |
| 307 bool show_keyboard_toggle, | 307 bool show_keyboard_toggle, |
| 308 SingleImeBehavior single_ime_behavior) | 308 SingleImeBehavior single_ime_behavior) |
| 309 : ImeListView(owner, show_keyboard_toggle, ImeListView::HIDE_SINGLE_IME) { | 309 : ImeListView(owner, show_keyboard_toggle, ImeListView::HIDE_SINGLE_IME) { |
| 310 SetFocusCurrentIme(true); |
| 310 } | 311 } |
| 311 | 312 |
| 312 ~ImeMenuListView() override {} | 313 ~ImeMenuListView() override {} |
| 313 | 314 |
| 314 protected: | 315 protected: |
| 315 void Layout() override { | 316 void Layout() override { |
| 316 gfx::Range height_range = GetImeListViewRange(); | 317 gfx::Range height_range = GetImeListViewRange(); |
| 317 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { | 318 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { |
| 318 scroller()->ClipHeightTo(height_range.start(), height_range.end()); | 319 scroller()->ClipHeightTo(height_range.start(), height_range.end()); |
| 319 } else { | 320 } else { |
| (...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); | 587 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); |
| 587 | 588 |
| 588 // Updates the tray label based on the current input method. | 589 // Updates the tray label based on the current input method. |
| 589 if (current_ime_.third_party) | 590 if (current_ime_.third_party) |
| 590 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); | 591 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); |
| 591 else | 592 else |
| 592 label_->SetText(current_ime_.short_name); | 593 label_->SetText(current_ime_.short_name); |
| 593 } | 594 } |
| 594 | 595 |
| 595 } // namespace ash | 596 } // namespace ash |
| OLD | NEW |