| 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 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 SystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); | 361 SystemTrayNotifier* tray_notifier = WmShell::Get()->system_tray_notifier(); |
| 362 tray_notifier->RemoveIMEObserver(this); | 362 tray_notifier->RemoveIMEObserver(this); |
| 363 tray_notifier->RemoveVirtualKeyboardObserver(this); | 363 tray_notifier->RemoveVirtualKeyboardObserver(this); |
| 364 } | 364 } |
| 365 | 365 |
| 366 void ImeMenuTray::ShowImeMenuBubble() { | 366 void ImeMenuTray::ShowImeMenuBubble() { |
| 367 int minimum_menu_width = GetMinimumMenuWidth(); | 367 int minimum_menu_width = GetMinimumMenuWidth(); |
| 368 should_block_shelf_auto_hide_ = true; | 368 should_block_shelf_auto_hide_ = true; |
| 369 views::TrayBubbleView::InitParams init_params( | 369 views::TrayBubbleView::InitParams init_params( |
| 370 GetAnchorAlignment(), minimum_menu_width, minimum_menu_width); | 370 GetAnchorAlignment(), minimum_menu_width, minimum_menu_width); |
| 371 init_params.can_activate = true; | |
| 372 init_params.close_on_deactivate = true; | 371 init_params.close_on_deactivate = true; |
| 373 | 372 |
| 374 views::TrayBubbleView* bubble_view = | 373 views::TrayBubbleView* bubble_view = |
| 375 views::TrayBubbleView::Create(GetBubbleAnchor(), this, &init_params); | 374 views::TrayBubbleView::Create(GetBubbleAnchor(), this, &init_params); |
| 376 bubble_view->set_anchor_view_insets(GetBubbleAnchorInsets()); | 375 bubble_view->set_anchor_view_insets(GetBubbleAnchorInsets()); |
| 377 | 376 |
| 378 // In the material design, we will add a title item with a separator on the | 377 // In the material design, we will add a title item with a separator on the |
| 379 // top of the IME menu. | 378 // top of the IME menu. |
| 380 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { | 379 if (MaterialDesignController::IsSystemTrayMenuMaterial()) { |
| 381 bubble_view->AddChildView( | 380 bubble_view->AddChildView( |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 586 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); | 585 WmShell::Get()->system_tray_delegate()->GetCurrentIME(¤t_ime_); |
| 587 | 586 |
| 588 // Updates the tray label based on the current input method. | 587 // Updates the tray label based on the current input method. |
| 589 if (current_ime_.third_party) | 588 if (current_ime_.third_party) |
| 590 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); | 589 label_->SetText(current_ime_.short_name + base::UTF8ToUTF16("*")); |
| 591 else | 590 else |
| 592 label_->SetText(current_ime_.short_name); | 591 label_->SetText(current_ime_.short_name); |
| 593 } | 592 } |
| 594 | 593 |
| 595 } // namespace ash | 594 } // namespace ash |
| OLD | NEW |