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

Side by Side Diff: components/metrics/ui/screen_info_metrics_provider.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 10 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "components/metrics/ui/screen_info_metrics_provider.h" 5 #include "components/metrics/ui/screen_info_metrics_provider.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "components/metrics/proto/system_profile.pb.h" 8 #include "components/metrics/proto/system_profile.pb.h"
9 #include "ui/gfx/screen.h" 9 #include "ui/gfx/screen.h"
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 hardware->set_primary_screen_height(display_size.height()); 71 hardware->set_primary_screen_height(display_size.height());
72 hardware->set_primary_screen_scale_factor(GetScreenDeviceScaleFactor()); 72 hardware->set_primary_screen_scale_factor(GetScreenDeviceScaleFactor());
73 hardware->set_screen_count(GetScreenCount()); 73 hardware->set_screen_count(GetScreenCount());
74 74
75 #if defined(OS_WIN) 75 #if defined(OS_WIN)
76 WriteScreenDPIInformationProto(hardware); 76 WriteScreenDPIInformationProto(hardware);
77 #endif 77 #endif
78 } 78 }
79 79
80 gfx::Size ScreenInfoMetricsProvider::GetScreenSize() const { 80 gfx::Size ScreenInfoMetricsProvider::GetScreenSize() const {
81 return gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().GetSizeInPixel(); 81 return gfx::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel();
82 } 82 }
83 83
84 float ScreenInfoMetricsProvider::GetScreenDeviceScaleFactor() const { 84 float ScreenInfoMetricsProvider::GetScreenDeviceScaleFactor() const {
85 return gfx::Screen::GetNativeScreen()-> 85 return gfx::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor();
86 GetPrimaryDisplay().device_scale_factor();
87 } 86 }
88 87
89 int ScreenInfoMetricsProvider::GetScreenCount() const { 88 int ScreenInfoMetricsProvider::GetScreenCount() const {
90 // TODO(scottmg): NativeScreen maybe wrong. http://crbug.com/133312 89 return gfx::Screen::GetScreen()->GetNumDisplays();
91 return gfx::Screen::GetNativeScreen()->GetNumDisplays();
92 } 90 }
93 91
94 } // namespace metrics 92 } // namespace metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698