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

Side by Side Diff: mojo/services/native_viewport/native_viewport_x11.cc

Issue 324823002: mojo: handle WM_DELETE_WINDOW in native_viewport_x11 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 | 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "mojo/services/native_viewport/native_viewport.h" 5 #include "mojo/services/native_viewport/native_viewport.h"
6 6
7 #include <X11/Xlib.h> 7 #include <X11/Xlib.h>
8 #include <X11/Xutil.h> 8 #include <X11/Xutil.h>
9 9
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 // TODO(aa): This is going to have to be thought through more carefully. 113 // TODO(aa): This is going to have to be thought through more carefully.
114 // Which events are appropriate to pass to clients? 114 // Which events are appropriate to pass to clients?
115 switch (event->type) { 115 switch (event->type) {
116 case KeyPress: 116 case KeyPress:
117 case KeyRelease: 117 case KeyRelease:
118 case ButtonPress: 118 case ButtonPress:
119 case ButtonRelease: 119 case ButtonRelease:
120 case MotionNotify: 120 case MotionNotify:
121 return true; 121 return true;
122 case ClientMessage: 122 case ClientMessage:
123 return event->xclient.message_type != atom_wm_protocols_; 123 return event->xclient.message_type == atom_wm_protocols_;
124 default: 124 default:
125 return false; 125 return false;
126 } 126 }
127 } 127 }
128 128
129 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE { 129 virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE {
130 if (event->type == ClientMessage) { 130 if (event->type == ClientMessage) {
131 Atom protocol = static_cast<Atom>(event->xclient.data.l[0]); 131 Atom protocol = static_cast<Atom>(event->xclient.data.l[0]);
132 if (protocol == atom_wm_delete_window_) 132 if (protocol == atom_wm_delete_window_)
133 delegate_->OnDestroyed(); 133 delegate_->OnDestroyed();
(...skipping 20 matching lines...) Expand all
154 154
155 // static 155 // static
156 scoped_ptr<NativeViewport> NativeViewport::Create( 156 scoped_ptr<NativeViewport> NativeViewport::Create(
157 shell::Context* context, 157 shell::Context* context,
158 NativeViewportDelegate* delegate) { 158 NativeViewportDelegate* delegate) {
159 return scoped_ptr<NativeViewport>(new NativeViewportX11(delegate)).Pass(); 159 return scoped_ptr<NativeViewport>(new NativeViewportX11(delegate)).Pass();
160 } 160 }
161 161
162 } // namespace services 162 } // namespace services
163 } // namespace mojo 163 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698