Chromium Code Reviews| Index: chrome/browser/extensions/api/system_display/display_info_provider_gtk.cc |
| diff --git a/chrome/browser/extensions/api/system_display/display_info_provider_x11.cc b/chrome/browser/extensions/api/system_display/display_info_provider_gtk.cc |
| similarity index 62% |
| rename from chrome/browser/extensions/api/system_display/display_info_provider_x11.cc |
| rename to chrome/browser/extensions/api/system_display/display_info_provider_gtk.cc |
| index 3776bf90bb496b07dfd5eb437a4dd5d98c7bfa41..9f8f899e3d633de9c5b3e54db95d38b6c0f6a888 100644 |
| --- a/chrome/browser/extensions/api/system_display/display_info_provider_x11.cc |
| +++ b/chrome/browser/extensions/api/system_display/display_info_provider_gtk.cc |
| @@ -4,6 +4,11 @@ |
| #include "chrome/browser/extensions/api/system_display/display_info_provider.h" |
| +#include <gdk/gdk.h> |
| + |
| +#include "ui/gfx/display.h" |
| +#include "ui/gfx/screen.h" |
| + |
| namespace extensions { |
| void DisplayInfoProvider::SetInfo( |
| @@ -18,7 +23,13 @@ void DisplayInfoProvider::SetInfo( |
| void DisplayInfoProvider::UpdateDisplayUnitInfoForPlatform( |
| const gfx::Display& display, |
| extensions::api::system_display::DisplayUnitInfo* unit) { |
| - NOTIMPLEMENTED(); |
| + // TODO(Haojian): determine the DPI of the display |
|
Haojian Wu
2013/08/26 11:58:36
oshima@, I find a strange problem while calculatin
oshima
2013/08/26 20:27:57
Monitor's info may or may not be available. Can yo
Haojian Wu
2013/08/27 01:35:48
Running xrandr command, the output also shows 0mm*
|
| + GdkScreen* screen = gdk_screen_get_default(); |
| + // The |id| in Display for GTK is the monitor index. |
| + gint monitor_num = static_cast<gint>(display.id()); |
| + char* monitor_name = reinterpret_cast<char*>(gdk_screen_get_monitor_plug_name( |
| + screen, monitor_num)); |
| + unit->name = std::string(monitor_name); |
| } |
| } // namespace extensions |