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

Side by Side Diff: win8/metro_driver/display_properties.cc

Issue 227573007: Third part of porting Chrome Ash to Windows 7 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: lf Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "stdafx.h" 5 #include "stdafx.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <wrl\implements.h> 8 #include <wrl\implements.h>
9 #include <wrl\wrappers\corewrappers.h> 9 #include <wrl\wrappers\corewrappers.h>
10 #include <windows.foundation.h> 10 #include <windows.foundation.h>
11 #include <windows.graphics.display.h> 11 #include <windows.graphics.display.h>
12 #include "base/win/scoped_com_initializer.h" 12 #include "base/win/scoped_com_initializer.h"
13 #include "base/win/windows_version.h"
13 #include "winrt_utils.h" 14 #include "winrt_utils.h"
14 15
15 #pragma comment(lib, "runtimeobject.lib") 16 #pragma comment(lib, "runtimeobject.lib")
16 17
17 extern "C" { 18 extern "C" {
18 19
19 __declspec(dllexport) float GetModernUIScale() { 20 __declspec(dllexport) float GetModernUIScale() {
21 if (base::win::GetVersion() < base::win::VERSION_WIN8)
ananta 2014/04/11 02:25:24 Please put a todo here to return the correct dpi s
22 return 1.0f;
23
20 base::win::ScopedCOMInitializer com_init; 24 base::win::ScopedCOMInitializer com_init;
21 Microsoft::WRL::ComPtr< 25 Microsoft::WRL::ComPtr<
22 ABI::Windows::Graphics::Display::IDisplayPropertiesStatics> 26 ABI::Windows::Graphics::Display::IDisplayPropertiesStatics>
23 display_properties; 27 display_properties;
24 if (SUCCEEDED(winrt_utils::CreateActivationFactory( 28 if (SUCCEEDED(winrt_utils::CreateActivationFactory(
25 RuntimeClass_Windows_Graphics_Display_DisplayProperties, 29 RuntimeClass_Windows_Graphics_Display_DisplayProperties,
26 display_properties.GetAddressOf()))) { 30 display_properties.GetAddressOf()))) {
27 ABI::Windows::Graphics::Display::ResolutionScale resolution_scale; 31 ABI::Windows::Graphics::Display::ResolutionScale resolution_scale;
28 if (SUCCEEDED(display_properties->get_ResolutionScale(&resolution_scale))) 32 if (SUCCEEDED(display_properties->get_ResolutionScale(&resolution_scale)))
29 return static_cast<float>(resolution_scale) / 100.0f; 33 return static_cast<float>(resolution_scale) / 100.0f;
30 } 34 }
31 return 1.0f; 35 return 1.0f;
32 } 36 }
33 37
34 } 38 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698