| 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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 scroller()->ClipHeightTo(height_range.start(), height_range.end()); | 348 scroller()->ClipHeightTo(height_range.start(), height_range.end()); |
| 349 ImeListView::Layout(); | 349 ImeListView::Layout(); |
| 350 } | 350 } |
| 351 | 351 |
| 352 DISALLOW_COPY_AND_ASSIGN(ImeMenuListView); | 352 DISALLOW_COPY_AND_ASSIGN(ImeMenuListView); |
| 353 }; | 353 }; |
| 354 | 354 |
| 355 } // namespace | 355 } // namespace |
| 356 | 356 |
| 357 ImeMenuTray::ImeMenuTray(WmShelf* wm_shelf) | 357 ImeMenuTray::ImeMenuTray(WmShelf* wm_shelf) |
| 358 : TrayBackgroundView(wm_shelf), | 358 : TrayBackgroundView(wm_shelf, true), |
| 359 label_(new ImeMenuLabel()), | 359 label_(new ImeMenuLabel()), |
| 360 show_keyboard_(false), | 360 show_keyboard_(false), |
| 361 force_show_keyboard_(false), | 361 force_show_keyboard_(false), |
| 362 should_block_shelf_auto_hide_(false), | 362 should_block_shelf_auto_hide_(false), |
| 363 keyboard_suppressed_(false), | 363 keyboard_suppressed_(false), |
| 364 show_bubble_after_keyboard_hidden_(false) { | 364 show_bubble_after_keyboard_hidden_(false) { |
| 365 if (MaterialDesignController::IsShelfMaterial()) { | 365 if (MaterialDesignController::IsShelfMaterial()) |
| 366 SetInkDropMode(InkDropMode::ON); | 366 SetInkDropMode(InkDropMode::ON); |
| 367 SetContentsBackground(false); | |
| 368 } else { | |
| 369 SetContentsBackground(true); | |
| 370 } | |
| 371 SetupLabelForTray(label_); | 367 SetupLabelForTray(label_); |
| 372 tray_container()->AddChildView(label_); | 368 tray_container()->AddChildView(label_); |
| 373 SystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); | 369 SystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); |
| 374 tray_notifier->AddIMEObserver(this); | 370 tray_notifier->AddIMEObserver(this); |
| 375 tray_notifier->AddVirtualKeyboardObserver(this); | 371 tray_notifier->AddVirtualKeyboardObserver(this); |
| 376 } | 372 } |
| 377 | 373 |
| 378 ImeMenuTray::~ImeMenuTray() { | 374 ImeMenuTray::~ImeMenuTray() { |
| 379 if (bubble_) | 375 if (bubble_) |
| 380 bubble_->bubble_view()->reset_delegate(); | 376 bubble_->bubble_view()->reset_delegate(); |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); | 644 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); |
| 649 | 645 |
| 650 // Updates the tray label based on the current input method. | 646 // Updates the tray label based on the current input method. |
| 651 if (current_ime_.third_party) | 647 if (current_ime_.third_party) |
| 652 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); | 648 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); |
| 653 else | 649 else |
| 654 label_->SetText(current_ime_.short_name); | 650 label_->SetText(current_ime_.short_name); |
| 655 } | 651 } |
| 656 | 652 |
| 657 } // namespace ash | 653 } // namespace ash |
| OLD | NEW |