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

Side by Side Diff: views/controls/menu/nested_dispatcher_gtk.cc

Issue 7250001: Refactor the glib message-pump, and use it as the base for a gtk message pump and an X message pump. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: media.gyp update Created 9 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 | « views/controls/menu/nested_dispatcher_gtk.h ('k') | views/focus/accelerator_handler.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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/controls/menu/nested_dispatcher_gtk.h" 5 #include "views/controls/menu/nested_dispatcher_gtk.h"
6 6
7 #if defined(TOUCH_UI) 7 #if defined(TOUCH_UI)
8 #include "views/focus/accelerator_handler.h" 8 #include "views/focus/accelerator_handler.h"
9 #endif 9 #endif
10 10
11 namespace views { 11 namespace views {
(...skipping 13 matching lines...) Expand all
25 MessageLoopForUI::current()->SetNestableTasksAllowed(nestable); 25 MessageLoopForUI::current()->SetNestableTasksAllowed(nestable);
26 bool creator_is_deleted = creator_ == NULL; 26 bool creator_is_deleted = creator_ == NULL;
27 delete this; 27 delete this;
28 return creator_is_deleted; 28 return creator_is_deleted;
29 } 29 }
30 30
31 void NestedDispatcherGtk::CreatorDestroyed() { 31 void NestedDispatcherGtk::CreatorDestroyed() {
32 creator_ = NULL; 32 creator_ = NULL;
33 } 33 }
34 34
35 #if defined(TOUCH_UI)
36 base::MessagePumpDispatcher::DispatchStatus
37 NestedDispatcherGtk::Dispatch(XEvent* xevent) {
38 return creator_->Dispatch(xevent);
39 }
40 #else
35 bool NestedDispatcherGtk::Dispatch(GdkEvent* event) { 41 bool NestedDispatcherGtk::Dispatch(GdkEvent* event) {
36 if (creator_ != NULL) { 42 return creator_ && creator_->Dispatch(event);
37 #if defined(TOUCH_UI)
38 return static_cast<base::MessagePumpForUI::Dispatcher*>
39 (creator_)->Dispatch(event);
40 #else
41 return creator_->Dispatch(event);
42 #endif
43 } else {
44 return false;
45 }
46 } 43 }
47 44 #endif // defined(TOUCH_UI)
48 #if defined(TOUCH_UI)
49 base::MessagePumpGlibXDispatcher::DispatchStatus
50 NestedDispatcherGtk::DispatchX(XEvent* xevent) {
51 return creator_->DispatchX(xevent);
52 }
53 #endif
54 45
55 } // namespace views 46 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/nested_dispatcher_gtk.h ('k') | views/focus/accelerator_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698