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

Side by Side Diff: content/browser/power_save_blocker_x11.cc

Issue 23460052: Move XID, XDisplay, GetXDisplay and a few other types to ui/gfx/x/x11_types.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sdf 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/power_save_blocker_impl.h" 5 #include "content/browser/power_save_blocker_impl.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 #include <X11/extensions/dpms.h> 8 #include <X11/extensions/dpms.h>
9 // Xlib #defines Status, but we can't have that for some of our headers. 9 // Xlib #defines Status, but we can't have that for some of our headers.
10 #ifdef Status 10 #ifdef Status
(...skipping 11 matching lines...) Expand all
22 #include "base/memory/scoped_ptr.h" 22 #include "base/memory/scoped_ptr.h"
23 #include "base/memory/singleton.h" 23 #include "base/memory/singleton.h"
24 #include "base/message_loop/message_loop_proxy.h" 24 #include "base/message_loop/message_loop_proxy.h"
25 #include "base/nix/xdg_util.h" 25 #include "base/nix/xdg_util.h"
26 #include "base/synchronization/lock.h" 26 #include "base/synchronization/lock.h"
27 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
28 #include "dbus/bus.h" 28 #include "dbus/bus.h"
29 #include "dbus/message.h" 29 #include "dbus/message.h"
30 #include "dbus/object_path.h" 30 #include "dbus/object_path.h"
31 #include "dbus/object_proxy.h" 31 #include "dbus/object_proxy.h"
32 #include "ui/gfx/x/x11_types.h"
32 33
33 #if defined(TOOLKIT_GTK) 34 #if defined(TOOLKIT_GTK)
34 #include "base/message_loop/message_pump_gtk.h" 35 #include "base/message_loop/message_pump_gtk.h"
35 #else 36 #else
36 #include "base/message_loop/message_pump_x11.h" 37 #include "base/message_loop/message_pump_x11.h"
37 #endif 38 #endif
38 39
39 namespace { 40 namespace {
40 41
41 enum DBusAPI { 42 enum DBusAPI {
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // We don't care about checking the result. We assume it works; we can't 292 // We don't care about checking the result. We assume it works; we can't
292 // really do anything about it anyway if it fails. 293 // really do anything about it anyway if it fails.
293 inhibit_cookie_ = 0; 294 inhibit_cookie_ = 0;
294 295
295 bus_->ShutdownAndBlock(); 296 bus_->ShutdownAndBlock();
296 bus_ = NULL; 297 bus_ = NULL;
297 } 298 }
298 299
299 // static 300 // static
300 bool PowerSaveBlockerImpl::Delegate::DPMSEnabled() { 301 bool PowerSaveBlockerImpl::Delegate::DPMSEnabled() {
301 Display* display = base::MessagePumpForUI::GetDefaultXDisplay(); 302 XDisplay* display = base::MessagePumpForUI::GetDefaultXDisplay();
302 BOOL enabled = false; 303 BOOL enabled = false;
303 int dummy; 304 int dummy;
304 if (DPMSQueryExtension(display, &dummy, &dummy) && DPMSCapable(display)) { 305 if (DPMSQueryExtension(display, &dummy, &dummy) && DPMSCapable(display)) {
305 CARD16 state; 306 CARD16 state;
306 DPMSInfo(display, &state, &enabled); 307 DPMSInfo(display, &state, &enabled);
307 } 308 }
308 return enabled; 309 return enabled;
309 } 310 }
310 311
311 // static 312 // static
(...skipping 22 matching lines...) Expand all
334 PowerSaveBlockerType type, const std::string& reason) 335 PowerSaveBlockerType type, const std::string& reason)
335 : delegate_(new Delegate(type, reason)) { 336 : delegate_(new Delegate(type, reason)) {
336 delegate_->Init(); 337 delegate_->Init();
337 } 338 }
338 339
339 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() { 340 PowerSaveBlockerImpl::~PowerSaveBlockerImpl() {
340 delegate_->CleanUp(); 341 delegate_->CleanUp();
341 } 342 }
342 343
343 } // namespace content 344 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/aura/software_output_device_x11.cc ('k') | content/browser/renderer_host/backing_store_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698