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

Side by Side Diff: chrome/browser/extensions/display_info_provider_win.cc

Issue 2072633002: Add Get/SetDisplayLayout to chrome.system.display extension API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win Created 4 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/extensions/display_info_provider_win.h" 5 #include "chrome/browser/extensions/display_info_provider_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include "base/hash.h" 10 #include "base/hash.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "base/win/win_util.h" 13 #include "base/win/win_util.h"
14 #include "extensions/common/api/system_display.h" 14 #include "extensions/common/api/system_display.h"
15 #include "ui/display/display.h" 15 #include "ui/display/display.h"
16 #include "ui/display/win/dpi.h" 16 #include "ui/display/win/dpi.h"
17 #include "ui/gfx/geometry/size.h" 17 #include "ui/gfx/geometry/size.h"
18 18
19 namespace extensions { 19 namespace extensions {
20 20
21 using api::system_display::DisplayUnitInfo; 21 using api::system_display::DisplayUnitInfo;
22 22
23 namespace { 23 namespace {
24 24
25 BOOL CALLBACK 25 BOOL CALLBACK
26 EnumMonitorCallback(HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM data) { 26 EnumMonitorCallback(HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM data) {
27 DisplayUnitInfoList* all_displays = 27 DisplayInfoProvider::DisplayUnitInfoList* all_displays =
28 reinterpret_cast<DisplayUnitInfoList*>(data); 28 reinterpret_cast<DisplayInfoProvider::DisplayUnitInfoList*>(data);
29 DCHECK(all_displays); 29 DCHECK(all_displays);
30 30
31 DisplayUnitInfo unit; 31 DisplayUnitInfo unit;
32 32
33 MONITORINFOEX monitor_info; 33 MONITORINFOEX monitor_info;
34 ZeroMemory(&monitor_info, sizeof(MONITORINFOEX)); 34 ZeroMemory(&monitor_info, sizeof(MONITORINFOEX));
35 monitor_info.cbSize = sizeof(monitor_info); 35 monitor_info.cbSize = sizeof(monitor_info);
36 GetMonitorInfo(monitor, &monitor_info); 36 GetMonitorInfo(monitor, &monitor_info);
37 37
38 DISPLAY_DEVICE device; 38 DISPLAY_DEVICE device;
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 } 81 }
82 } 82 }
83 } 83 }
84 84
85 // static 85 // static
86 DisplayInfoProvider* DisplayInfoProvider::Create() { 86 DisplayInfoProvider* DisplayInfoProvider::Create() {
87 return new DisplayInfoProviderWin(); 87 return new DisplayInfoProviderWin();
88 } 88 }
89 89
90 } // namespace extensions 90 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698