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

Unified Diff: chrome/browser/extensions/api/system_display/display_info_provider_gtk.cc

Issue 22891026: [SystemInfo API] Implement DisplayInfoProvider::UpdateDisplayUnitInfoForPlatform for Linux GTK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 4 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 | « no previous file | chrome/browser/extensions/api/system_display/display_info_provider_x11.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | chrome/browser/extensions/api/system_display/display_info_provider_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698