1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/extensions/api/system_display/display_info_provider.h"
9 #include "ui/gfx/display.h"
10 #include "ui/gfx/screen.h"
12 namespace extensions {
14 bool DisplayInfoProvider::SetInfo(const std::string& display_id,
15 const api::system_display::DisplayProperties& info,
17 *error = "Not Implemented";
21 void DisplayInfoProvider::UpdateDisplayUnitInfoForPlatform(
22 const gfx::Display& display,
23 extensions::api::system_display::DisplayUnitInfo* unit) {
24 // TODO(Haojian): determine the DPI of the display
25 GdkScreen* screen = gdk_screen_get_default();
26 // The |id| in Display for GTK is the monitor index.
27 gint monitor_num = static_cast<gint>(display.id());
28 char* monitor_name = reinterpret_cast<char*>(gdk_screen_get_monitor_plug_name(
29 screen, monitor_num));
31 unit->name = std::string(monitor_name);
34 } // namespace extensions