Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Unified Diff: ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc

Issue 2445293002: Make the virtual keyboard show up on the display with input focus. (Closed)
Patch Set: rebase & update Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
diff --git a/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc b/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
index 72d36daa7bb1f88c3ebfe43f1cc4103081e0c3ca..066f20d9a9e7ea7c6f20959d21bcc36646815cfb 100644
--- a/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
+++ b/ash/common/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc
@@ -9,14 +9,17 @@
#include "ash/common/keyboard/keyboard_ui.h"
#include "ash/common/material_design/material_design_controller.h"
#include "ash/common/shelf/shelf_constants.h"
+#include "ash/common/shelf/wm_shelf.h"
#include "ash/common/shelf/wm_shelf_util.h"
#include "ash/common/system/tray/tray_constants.h"
#include "ash/common/system/tray/tray_utils.h"
#include "ash/common/wm_shell.h"
+#include "ash/common/wm_window.h"
#include "grit/ash_resources.h"
#include "grit/ash_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/display/display.h"
#include "ui/events/event.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/paint_vector_icon.h"
@@ -27,7 +30,9 @@
namespace ash {
VirtualKeyboardTray::VirtualKeyboardTray(WmShelf* wm_shelf)
- : TrayBackgroundView(wm_shelf), icon_(new views::ImageView) {
+ : TrayBackgroundView(wm_shelf),
+ display_id_(wm_shelf->GetWindow()->GetDisplayNearestWindow().id()),
oshima 2016/11/08 17:26:04 This mapping may change. Please get this when show
yhanada 2016/11/14 22:48:47 Done.
+ icon_(new views::ImageView) {
if (MaterialDesignController::IsShelfMaterial()) {
gfx::ImageSkia image_md =
CreateVectorIcon(gfx::VectorIconId::SHELF_KEYBOARD, kShelfIconColor);
@@ -76,7 +81,7 @@ void VirtualKeyboardTray::HideBubbleWithView(
void VirtualKeyboardTray::ClickedOutsideBubble() {}
bool VirtualKeyboardTray::PerformAction(const ui::Event& event) {
- WmShell::Get()->keyboard_ui()->Show();
+ WmShell::Get()->keyboard_ui()->ShowInSpecificDisplay(display_id_);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698