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

Side by Side Diff: ui/views/widget/desktop_aura/desktop_screen_x11.cc

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 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
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_screen_x11.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/views/widget/desktop_aura/desktop_screen_x11.h" 5 #include "ui/views/widget/desktop_aura/desktop_screen_x11.h"
6 6
7 #include <X11/extensions/Xrandr.h> 7 #include <X11/extensions/Xrandr.h>
8 #include <X11/Xlib.h> 8 #include <X11/Xlib.h>
9 9
10 // It clashes with out RootWindow. 10 // It clashes with out RootWindow.
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 uint32_t DesktopScreenX11::DispatchEvent(const ui::PlatformEvent& event) { 231 uint32_t DesktopScreenX11::DispatchEvent(const ui::PlatformEvent& event) {
232 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) { 232 if (event->type - xrandr_event_base_ == RRScreenChangeNotify) {
233 // Pass the event through to xlib. 233 // Pass the event through to xlib.
234 XRRUpdateConfiguration(event); 234 XRRUpdateConfiguration(event);
235 } else if (event->type - xrandr_event_base_ == RRNotify) { 235 } else if (event->type - xrandr_event_base_ == RRNotify) {
236 // There's some sort of observer dispatch going on here, but I don't think 236 // There's some sort of observer dispatch going on here, but I don't think
237 // it's the screen's? 237 // it's the screen's?
238 if (configure_timer_.get() && configure_timer_->IsRunning()) { 238 if (configure_timer_.get() && configure_timer_->IsRunning()) {
239 configure_timer_->Reset(); 239 configure_timer_->Reset();
240 } else { 240 } else {
241 configure_timer_.reset(new base::OneShotTimer<DesktopScreenX11>()); 241 configure_timer_.reset(new base::OneShotTimer());
242 configure_timer_->Start( 242 configure_timer_->Start(
243 FROM_HERE, 243 FROM_HERE,
244 base::TimeDelta::FromMilliseconds(kConfigureDelayMs), 244 base::TimeDelta::FromMilliseconds(kConfigureDelayMs),
245 this, 245 this,
246 &DesktopScreenX11::ConfigureTimerFired); 246 &DesktopScreenX11::ConfigureTimerFired);
247 } 247 }
248 } else { 248 } else {
249 NOTREACHED(); 249 NOTREACHED();
250 } 250 }
251 251
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 change_notifier_.NotifyDisplaysChanged(old_displays, displays_); 362 change_notifier_.NotifyDisplaysChanged(old_displays, displays_);
363 } 363 }
364 364
365 //////////////////////////////////////////////////////////////////////////////// 365 ////////////////////////////////////////////////////////////////////////////////
366 366
367 gfx::Screen* CreateDesktopScreen() { 367 gfx::Screen* CreateDesktopScreen() {
368 return new DesktopScreenX11; 368 return new DesktopScreenX11;
369 } 369 }
370 370
371 } // namespace views 371 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_screen_x11.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698