| OLD | NEW |
| 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/display/screen.h" |
| 10 | 10 |
| 11 namespace metrics { | 11 namespace metrics { |
| 12 | 12 |
| 13 #if defined(OS_WIN) | 13 #if defined(OS_WIN) |
| 14 | 14 |
| 15 #include <windows.h> | 15 #include <windows.h> |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 struct ScreenDPIInformation { | 19 struct ScreenDPIInformation { |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); | 81 return display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); |
| 82 } | 82 } |
| 83 | 83 |
| 84 float ScreenInfoMetricsProvider::GetScreenDeviceScaleFactor() const { | 84 float ScreenInfoMetricsProvider::GetScreenDeviceScaleFactor() const { |
| 85 return gfx::Screen::GetScreen()->GetPrimaryDisplay().device_scale_factor(); | 85 return display::Screen::GetScreen() |
| 86 ->GetPrimaryDisplay() |
| 87 .device_scale_factor(); |
| 86 } | 88 } |
| 87 | 89 |
| 88 int ScreenInfoMetricsProvider::GetScreenCount() const { | 90 int ScreenInfoMetricsProvider::GetScreenCount() const { |
| 89 return gfx::Screen::GetScreen()->GetNumDisplays(); | 91 return display::Screen::GetScreen()->GetNumDisplays(); |
| 90 } | 92 } |
| 91 | 93 |
| 92 } // namespace metrics | 94 } // namespace metrics |
| OLD | NEW |