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

Side by Side Diff: ui/wm/core/nested_accelerator_dispatcher_linux.cc

Issue 855023003: Add presubmit check for scoped_ptr usage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: REBASE Created 5 years, 11 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_cursor_loader_updater_aurawin.cc ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/wm/core/nested_accelerator_dispatcher.h" 5 #include "ui/wm/core/nested_accelerator_dispatcher.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "ui/base/accelerators/accelerator.h" 9 #include "ui/base/accelerators/accelerator.h"
10 #include "ui/events/event.h" 10 #include "ui/events/event.h"
(...skipping 20 matching lines...) Expand all
31 bool IsKeyEvent(const XEvent* xev) { 31 bool IsKeyEvent(const XEvent* xev) {
32 return xev->type == KeyPress || xev->type == KeyRelease; 32 return xev->type == KeyPress || xev->type == KeyRelease;
33 } 33 }
34 #else 34 #else
35 #error Unknown build platform: you should have either use_ozone or use_x11. 35 #error Unknown build platform: you should have either use_ozone or use_x11.
36 #endif 36 #endif
37 37
38 scoped_ptr<ui::ScopedEventDispatcher> OverrideDispatcher( 38 scoped_ptr<ui::ScopedEventDispatcher> OverrideDispatcher(
39 ui::PlatformEventDispatcher* dispatcher) { 39 ui::PlatformEventDispatcher* dispatcher) {
40 ui::PlatformEventSource* source = ui::PlatformEventSource::GetInstance(); 40 ui::PlatformEventSource* source = ui::PlatformEventSource::GetInstance();
41 return source ? source->OverrideDispatcher(dispatcher) 41 return source ? source->OverrideDispatcher(dispatcher) : nullptr;
42 : scoped_ptr<ui::ScopedEventDispatcher>();
43 } 42 }
44 43
45 } // namespace 44 } // namespace
46 45
47 class NestedAcceleratorDispatcherLinux : public NestedAcceleratorDispatcher, 46 class NestedAcceleratorDispatcherLinux : public NestedAcceleratorDispatcher,
48 public ui::PlatformEventDispatcher { 47 public ui::PlatformEventDispatcher {
49 public: 48 public:
50 explicit NestedAcceleratorDispatcherLinux(NestedAcceleratorDelegate* delegate) 49 explicit NestedAcceleratorDispatcherLinux(NestedAcceleratorDelegate* delegate)
51 : NestedAcceleratorDispatcher(delegate), 50 : NestedAcceleratorDispatcher(delegate),
52 restore_dispatcher_(OverrideDispatcher(this)) {} 51 restore_dispatcher_(OverrideDispatcher(this)) {}
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 DISALLOW_COPY_AND_ASSIGN(NestedAcceleratorDispatcherLinux); 93 DISALLOW_COPY_AND_ASSIGN(NestedAcceleratorDispatcherLinux);
95 }; 94 };
96 95
97 scoped_ptr<NestedAcceleratorDispatcher> NestedAcceleratorDispatcher::Create( 96 scoped_ptr<NestedAcceleratorDispatcher> NestedAcceleratorDispatcher::Create(
98 NestedAcceleratorDelegate* delegate, 97 NestedAcceleratorDelegate* delegate,
99 base::MessagePumpDispatcher* nested_dispatcher) { 98 base::MessagePumpDispatcher* nested_dispatcher) {
100 return make_scoped_ptr(new NestedAcceleratorDispatcherLinux(delegate)); 99 return make_scoped_ptr(new NestedAcceleratorDispatcherLinux(delegate));
101 } 100 }
102 101
103 } // namespace wm 102 } // namespace wm
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_cursor_loader_updater_aurawin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698