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

Unified Diff: ui/views/controls/prefix_selector.cc

Issue 2593323002: Use the physical-pixel space for native IME on linux platform. (Closed)
Patch Set: Created 4 years 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: ui/views/controls/prefix_selector.cc
diff --git a/ui/views/controls/prefix_selector.cc b/ui/views/controls/prefix_selector.cc
index f9fae7108c0f462e9359343e324a7718399ee344..2bda263c77caa7ed406e519c3aba280acd560594 100644
--- a/ui/views/controls/prefix_selector.cc
+++ b/ui/views/controls/prefix_selector.cc
@@ -7,6 +7,8 @@
#include "base/i18n/case_conversion.h"
#include "ui/base/ime/input_method.h"
#include "ui/base/ime/text_input_type.h"
+#include "ui/display/display.h"
+#include "ui/display/screen.h"
#include "ui/gfx/range/range.h"
#include "ui/views/controls/prefix_delegate.h"
#include "ui/views/view.h"
@@ -77,6 +79,11 @@ bool PrefixSelector::CanComposeInline() const {
return false;
}
+float PrefixSelector::GetScaleFactor() const {
+ return display::Screen::GetScreen()->GetDisplayNearestWindow(
+ host_view_->GetWidget()->GetNativeWindow()).device_scale_factor();
+}
+
gfx::Rect PrefixSelector::GetCaretBounds() const {
gfx::Rect rect(host_view_->GetVisibleBounds().origin(), gfx::Size());
// TextInputClient::GetCaretBounds is expected to return a value in screen

Powered by Google App Engine
This is Rietveld 408576698