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

Side by Side Diff: ash/accelerators/accelerator_dispatcher_linux.cc

Issue 274383002: events: Remove ability to terminate a nested message-loop from the event-source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/events/platform/platform_event_dispatcher.h » ('j') | 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 "ash/accelerators/accelerator_dispatcher.h" 5 #include "ash/accelerators/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/events/event.h" 9 #include "ui/events/event.h"
10 #include "ui/events/platform/platform_event_dispatcher.h" 10 #include "ui/events/platform/platform_event_dispatcher.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE { 63 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
64 if (IsKeyEvent(event)) { 64 if (IsKeyEvent(event)) {
65 ui::KeyEvent key_event(event, false); 65 ui::KeyEvent key_event(event, false);
66 if (MenuClosedForPossibleAccelerator(key_event)) { 66 if (MenuClosedForPossibleAccelerator(key_event)) {
67 #if defined(USE_X11) 67 #if defined(USE_X11)
68 XPutBackEvent(event->xany.display, event); 68 XPutBackEvent(event->xany.display, event);
69 #else 69 #else
70 NOTIMPLEMENTED(); 70 NOTIMPLEMENTED();
71 #endif 71 #endif
72 return ui::POST_DISPATCH_QUIT_LOOP; 72 return ui::POST_DISPATCH_NONE;
sadrul 2014/05/14 17:46:33 MenuClosedForPossibleAccelerator() (line 66) calls
73 } 73 }
74 74
75 if (AcceleratorProcessedForKeyEvent(key_event)) 75 if (AcceleratorProcessedForKeyEvent(key_event))
76 return ui::POST_DISPATCH_NONE; 76 return ui::POST_DISPATCH_NONE;
77 } 77 }
78 78
79 ui::PlatformEventDispatcher* prev = *restore_dispatcher_; 79 ui::PlatformEventDispatcher* prev = *restore_dispatcher_;
80 return prev ? prev->DispatchEvent(event) 80 return prev ? prev->DispatchEvent(event)
81 : ui::POST_DISPATCH_PERFORM_DEFAULT; 81 : ui::POST_DISPATCH_PERFORM_DEFAULT;
82 } 82 }
83 83
84 scoped_ptr<ui::ScopedEventDispatcher> restore_dispatcher_; 84 scoped_ptr<ui::ScopedEventDispatcher> restore_dispatcher_;
85 85
86 DISALLOW_COPY_AND_ASSIGN(AcceleratorDispatcherLinux); 86 DISALLOW_COPY_AND_ASSIGN(AcceleratorDispatcherLinux);
87 }; 87 };
88 88
89 scoped_ptr<AcceleratorDispatcher> AcceleratorDispatcher::Create( 89 scoped_ptr<AcceleratorDispatcher> AcceleratorDispatcher::Create(
90 base::MessagePumpDispatcher* nested_dispatcher) { 90 base::MessagePumpDispatcher* nested_dispatcher) {
91 return scoped_ptr<AcceleratorDispatcher>(new AcceleratorDispatcherLinux()); 91 return scoped_ptr<AcceleratorDispatcher>(new AcceleratorDispatcherLinux());
92 } 92 }
93 93
94 } // namespace ash 94 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ui/events/platform/platform_event_dispatcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698