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

Side by Side Diff: chrome/browser/extensions/api/system_display/display_info_provider_linux.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, 3 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 2013 The Chromium Authors. All rights reserved. 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 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/api/system_display/display_info_provider.h" 5 #include "chrome/browser/extensions/api/system_display/display_info_provider.h"
Haojian Wu 2013/09/02 09:08:12 Refer to the linux_aura buildbot error stdio log,
oshima 2013/09/03 17:14:05 this should be renamed to dispaly_info_provider_gt
Haojian Wu 2013/09/04 15:02:56 Done.
6 6
7 #include <gdk/gdk.h>
8
9 #include "ui/gfx/display.h"
10 #include "ui/gfx/screen.h"
11
7 namespace extensions { 12 namespace extensions {
8 13
9 void DisplayInfoProvider::SetInfo( 14 void DisplayInfoProvider::SetInfo(
10 const std::string& display_id, 15 const std::string& display_id,
11 const api::system_display::DisplayProperties& info, 16 const api::system_display::DisplayProperties& info,
12 const SetInfoCallback& callback) { 17 const SetInfoCallback& callback) {
13 base::MessageLoopProxy::current()->PostTask( 18 base::MessageLoopProxy::current()->PostTask(
14 FROM_HERE, 19 FROM_HERE,
15 base::Bind(callback, false, "Not implemented")); 20 base::Bind(callback, false, "234 implemented"));
Hongbo Min 2013/09/04 01:46:04 what is the '234' meaning here?
Haojian Wu 2013/09/04 15:02:56 Just a typo error. Done.
16 } 21 }
17 22
18 void DisplayInfoProvider::UpdateDisplayUnitInfoForPlatform( 23 void DisplayInfoProvider::UpdateDisplayUnitInfoForPlatform(
19 const gfx::Display& display, 24 const gfx::Display& display,
20 extensions::api::system_display::DisplayUnitInfo* unit) { 25 extensions::api::system_display::DisplayUnitInfo* unit) {
21 NOTIMPLEMENTED(); 26 // TODO(Haojian): determine the DPI of the display
27 GdkScreen* screen = gdk_screen_get_default();
28 // The |id| in Display for GTK is the monitor index.
29 gint monitor_num = static_cast<gint>(display.id());
30 char* monitor_name = reinterpret_cast<char*>(gdk_screen_get_monitor_plug_name(
31 screen, monitor_num));
32 unit->name = std::string(monitor_name);
22 } 33 }
23 34
24 } // namespace extensions 35 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698