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

Unified Diff: win8/metro_driver/chrome_app_view_ash.cc

Issue 271543009: Send the device scale factor from Windows 8 ASH during initialization via the MetroViewerHostMsg_Se… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reverted changes to printed_document_win.cc Created 6 years, 7 months 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: win8/metro_driver/chrome_app_view_ash.cc
diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc
index a82ab1f6fe22580e8cd696b97657ae14fb5a9506..775932b48d42ed64b0d4f3c3c4c7c79c40586799 100644
--- a/win8/metro_driver/chrome_app_view_ash.cc
+++ b/win8/metro_driver/chrome_app_view_ash.cc
@@ -74,6 +74,8 @@ struct Globals {
BreakpadExceptionHandler breakpad_exception_handler;
} globals;
+extern float GetModernUIScale();
+
namespace {
enum KeyModifier {
@@ -506,7 +508,8 @@ class ChromeAppViewAsh::PointerInfoHandler {
ChromeAppViewAsh::ChromeAppViewAsh()
: mouse_down_flags_(ui::EF_NONE),
ui_channel_(nullptr),
- core_window_hwnd_(NULL) {
+ core_window_hwnd_(NULL),
+ scale_(0) {
DVLOG(1) << __FUNCTION__;
globals.previous_state =
winapp::Activation::ApplicationExecutionState_NotRunning;
@@ -625,6 +628,9 @@ ChromeAppViewAsh::SetWindow(winui::Core::ICoreWindow* window) {
// we can now directly blit to it from the browser process.
direct3d_helper_.Initialize(window);
DVLOG(1) << "Initialized Direct3D.";
+
+ scale_ = GetModernUIScale();
+ DVLOG(1) << "Scale is " << scale_;
return S_OK;
}
@@ -669,7 +675,7 @@ ChromeAppViewAsh::Run() {
// Upon receipt of the MetroViewerHostMsg_SetTargetSurface message the
// browser will use D3D from the browser process to present to our Window.
ui_channel_->Send(new MetroViewerHostMsg_SetTargetSurface(
- gfx::NativeViewId(core_window_hwnd_)));
+ gfx::NativeViewId(core_window_hwnd_), scale_));
DVLOG(1) << "ICoreWindow sent " << core_window_hwnd_;
// Send an initial size message so that the Ash root window host gets sized

Powered by Google App Engine
This is Rietveld 408576698