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

Side by Side Diff: ui/views/controls/menu/nested_dispatcher_gtk.h

Issue 9728002: Removing deprecated GTK-Views code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef UI_VIEWS_CONTROLS_MENU_NESTED_DISPATCHER_GTK_H_
6 #define UI_VIEWS_CONTROLS_MENU_NESTED_DISPATCHER_GTK_H_
7 #pragma once
8
9 #include "base/compiler_specific.h"
10 #include "base/message_loop.h"
11
12 namespace views {
13
14 // A nested dispatcher that can out-live the creator of this
15 // dispatcher. This is to deal with the scenario where a menu object
16 // is deleted while it's handling the message loop. Note that
17 // |RunAndSelfDestruct| method always delete itself regardless of
18 // whether or not the menu object is deleted, so a menu object should
19 // create a new instance for each open request.
20 // http://crosbug.com/7228, http://crosbug.com/7929
21 class NestedDispatcherGtk : public MessageLoopForUI::Dispatcher {
22 public:
23 NestedDispatcherGtk(MessageLoopForUI::Dispatcher* creator,
24 bool allow_nested_task);
25
26 // Run the messsage loop and returns if the menu has been
27 // deleted in the nested loop. Returns true if the menu is
28 // deleted, or false otherwise.
29 bool RunAndSelfDestruct();
30
31 // Tells the nested dispatcher that creator has been destroyed.
32 void CreatorDestroyed();
33
34 private:
35 virtual ~NestedDispatcherGtk() {}
36
37 // Overriden from MessageLoopForUI::Dispatcher:
38 virtual bool Dispatch(GdkEvent* event) OVERRIDE;
39
40 // Creator of the nested loop.
41 MessageLoopForUI::Dispatcher* creator_;
42
43 // True to allow nested task in the message loop.
44 bool allow_nested_task_;
45
46 DISALLOW_COPY_AND_ASSIGN(NestedDispatcherGtk);
47 };
48
49 } // namespace views
50
51 #endif // UI_VIEWS_CONTROLS_MENU_NESTED_DISPATCHER_GTK_H_
OLDNEW
« no previous file with comments | « ui/views/controls/menu/native_menu_gtk.cc ('k') | ui/views/controls/menu/nested_dispatcher_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698