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

Unified Diff: ui/gfx/win/display_info.cc

Issue 1674433002: Revert of ScreenWin Testability and Restructuring (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/win/display_info.h ('k') | ui/gfx/win/screen_win_display.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/win/display_info.cc
diff --git a/ui/gfx/win/display_info.cc b/ui/gfx/win/display_info.cc
deleted file mode 100644
index 10df0fff9e87de5a6954febe8c1e4eb9be45cee5..0000000000000000000000000000000000000000
--- a/ui/gfx/win/display_info.cc
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/gfx/win/display_info.h"
-
-#include "base/hash.h"
-#include "base/strings/utf_string_conversions.h"
-
-namespace {
-
-gfx::Display::Rotation GetRotationForDevice(const wchar_t* device_name) {
- DEVMODE mode;
- ::ZeroMemory(&mode, sizeof(mode));
- mode.dmSize = sizeof(mode);
- mode.dmDriverExtra = 0;
- if (::EnumDisplaySettings(device_name, ENUM_CURRENT_SETTINGS, &mode)) {
- switch (mode.dmDisplayOrientation) {
- case DMDO_DEFAULT:
- return gfx::Display::ROTATE_0;
- case DMDO_90:
- return gfx::Display::ROTATE_90;
- case DMDO_180:
- return gfx::Display::ROTATE_180;
- case DMDO_270:
- return gfx::Display::ROTATE_270;
- default:
- NOTREACHED();
- }
- }
- return gfx::Display::ROTATE_0;
-}
-
-} // namespace
-
-namespace gfx {
-namespace win {
-
-DisplayInfo::DisplayInfo(const MONITORINFOEX& monitor_info,
- float device_scale_factor)
- : DisplayInfo(monitor_info,
- device_scale_factor,
- GetRotationForDevice(monitor_info.szDevice)) {}
-
-DisplayInfo::DisplayInfo(const MONITORINFOEX& monitor_info,
- float device_scale_factor,
- gfx::Display::Rotation rotation)
- : id(DeviceIdFromDeviceName(monitor_info.szDevice)),
- screen_rect(monitor_info.rcMonitor),
- screen_work_rect(monitor_info.rcWork),
- rotation(rotation),
- device_scale_factor(device_scale_factor) {}
-
-// static
-int64_t DisplayInfo::DeviceIdFromDeviceName(const wchar_t* device_name) {
- return static_cast<int64_t>(base::Hash(base::WideToUTF8(device_name)));
-}
-
-} // namespace win
-} // namespace gfx
« no previous file with comments | « ui/gfx/win/display_info.h ('k') | ui/gfx/win/screen_win_display.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698