Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/gfx/geometry/size.h" | 15 #include "ui/gfx/geometry/size.h" |
| 16 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
|
oshima
2016/01/20 06:40:12
remove this?
scottmg
2016/01/26 20:46:35
Done.
| |
| 17 #include "ui/gfx/win/dpi.h" | 17 #include "ui/gfx/win/dpi.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) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 75 for (size_t i = 0; i < all_displays.size(); ++i) { | 75 for (size_t i = 0; i < all_displays.size(); ++i) { |
| 76 if (unit->id == all_displays[i]->id) { | 76 if (unit->id == all_displays[i]->id) { |
| 77 unit->name = all_displays[i]->name; | 77 unit->name = all_displays[i]->name; |
| 78 unit->dpi_x = all_displays[i]->dpi_x; | 78 unit->dpi_x = all_displays[i]->dpi_x; |
| 79 unit->dpi_y = all_displays[i]->dpi_y; | 79 unit->dpi_y = all_displays[i]->dpi_y; |
| 80 break; | 80 break; |
| 81 } | 81 } |
| 82 } | 82 } |
| 83 } | 83 } |
| 84 | 84 |
| 85 gfx::Screen* DisplayInfoProviderWin::GetActiveScreen() { | |
| 86 return gfx::Screen::GetScreen(); | |
| 87 } | |
| 88 | |
| 89 // static | 85 // static |
| 90 DisplayInfoProvider* DisplayInfoProvider::Create() { | 86 DisplayInfoProvider* DisplayInfoProvider::Create() { |
| 91 return new DisplayInfoProviderWin(); | 87 return new DisplayInfoProviderWin(); |
| 92 } | 88 } |
| 93 | 89 |
| 94 } // namespace extensions | 90 } // namespace extensions |
| OLD | NEW |