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

Side by Side Diff: chrome/browser/extensions/api/system_display/display_info_provider_gtk.cc

Issue 23441032: [SystemInfo API] Rewrite DisplayInfoProvider without SystemInfoProvider. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 7 years, 2 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"
6 6
7 #include <gdk/gdk.h> 7 #include <gdk/gdk.h>
8 8
9 #include "ui/gfx/display.h" 9 #include "ui/gfx/display.h"
10 #include "ui/gfx/screen.h" 10 #include "ui/gfx/screen.h"
11 11
12 namespace extensions { 12 namespace extensions {
13 13
14 void DisplayInfoProvider::SetInfo( 14 bool DisplayInfoProvider::SetInfo(const std::string& display_id,
15 const std::string& display_id,
16 const api::system_display::DisplayProperties& info, 15 const api::system_display::DisplayProperties& info,
17 const SetInfoCallback& callback) { 16 std::string* error) {
18 base::MessageLoopProxy::current()->PostTask( 17 *error = "Not Implemented";
19 FROM_HERE, 18 return false;
20 base::Bind(callback, false, "Not implemented"));
21 } 19 }
22 20
23 void DisplayInfoProvider::UpdateDisplayUnitInfoForPlatform( 21 void DisplayInfoProvider::UpdateDisplayUnitInfoForPlatform(
24 const gfx::Display& display, 22 const gfx::Display& display,
25 extensions::api::system_display::DisplayUnitInfo* unit) { 23 extensions::api::system_display::DisplayUnitInfo* unit) {
26 // TODO(Haojian): determine the DPI of the display 24 // TODO(Haojian): determine the DPI of the display
27 GdkScreen* screen = gdk_screen_get_default(); 25 GdkScreen* screen = gdk_screen_get_default();
28 // The |id| in Display for GTK is the monitor index. 26 // The |id| in Display for GTK is the monitor index.
29 gint monitor_num = static_cast<gint>(display.id()); 27 gint monitor_num = static_cast<gint>(display.id());
30 char* monitor_name = reinterpret_cast<char*>(gdk_screen_get_monitor_plug_name( 28 char* monitor_name = reinterpret_cast<char*>(gdk_screen_get_monitor_plug_name(
31 screen, monitor_num)); 29 screen, monitor_num));
32 unit->name = std::string(monitor_name); 30 unit->name = std::string(monitor_name);
33 } 31 }
34 32
35 } // namespace extensions 33 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698