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

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: address the comments 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 ab969c45a89937a91d40c141e237906aeae9b200..2afeaa2ca14245b44b047d6f88e4242ccfed49a1 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),
+ icon_(new views::ImageView),
+ wm_shelf_(wm_shelf) {
if (MaterialDesignController::IsShelfMaterial()) {
gfx::ImageSkia image_md =
CreateVectorIcon(gfx::VectorIconId::SHELF_KEYBOARD, kShelfIconColor);
@@ -76,7 +81,9 @@ void VirtualKeyboardTray::HideBubbleWithView(
void VirtualKeyboardTray::ClickedOutsideBubble() {}
bool VirtualKeyboardTray::PerformAction(const ui::Event& event) {
- WmShell::Get()->keyboard_ui()->Show();
+ const int64_t display_id =
+ wm_shelf_->GetWindow()->GetDisplayNearestWindow().id();
+ WmShell::Get()->keyboard_ui()->ShowInDisplay(display_id);
return true;
}

Powered by Google App Engine
This is Rietveld 408576698