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

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

Issue 232133005: ozone: Protect X11-specific code under ash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, one more X11 line showed up Created 6 years, 8 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 | chrome/browser/ui/ash/ash_init.cc » ('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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 57
58 // ui::PlatformEventDispatcher: 58 // ui::PlatformEventDispatcher:
59 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE { 59 virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
60 return true; 60 return true;
61 } 61 }
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 XPutBackEvent(event->xany.display, event); 68 XPutBackEvent(event->xany.display, event);
69 #else
70 NOTIMPLEMENTED();
71 #endif
68 return ui::POST_DISPATCH_QUIT_LOOP; 72 return ui::POST_DISPATCH_QUIT_LOOP;
69 } 73 }
70 74
71 if (AcceleratorProcessedForKeyEvent(key_event)) 75 if (AcceleratorProcessedForKeyEvent(key_event))
72 return ui::POST_DISPATCH_NONE; 76 return ui::POST_DISPATCH_NONE;
73 } 77 }
74 78
75 ui::PlatformEventDispatcher* prev = *restore_dispatcher_; 79 ui::PlatformEventDispatcher* prev = *restore_dispatcher_;
76 return prev ? prev->DispatchEvent(event) 80 return prev ? prev->DispatchEvent(event)
77 : ui::POST_DISPATCH_PERFORM_DEFAULT; 81 : ui::POST_DISPATCH_PERFORM_DEFAULT;
78 } 82 }
79 83
80 scoped_ptr<ui::ScopedEventDispatcher> restore_dispatcher_; 84 scoped_ptr<ui::ScopedEventDispatcher> restore_dispatcher_;
81 85
82 DISALLOW_COPY_AND_ASSIGN(AcceleratorDispatcherLinux); 86 DISALLOW_COPY_AND_ASSIGN(AcceleratorDispatcherLinux);
83 }; 87 };
84 88
85 scoped_ptr<AcceleratorDispatcher> AcceleratorDispatcher::Create( 89 scoped_ptr<AcceleratorDispatcher> AcceleratorDispatcher::Create(
86 base::MessagePumpDispatcher* nested_dispatcher) { 90 base::MessagePumpDispatcher* nested_dispatcher) {
87 return scoped_ptr<AcceleratorDispatcher>(new AcceleratorDispatcherLinux()); 91 return scoped_ptr<AcceleratorDispatcher>(new AcceleratorDispatcherLinux());
88 } 92 }
89 93
90 } // namespace ash 94 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/ash/ash_init.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698