Implementing the dispatch of the swipe gesture for one-finger touch swipes.
[chromium-blink-merge.git] / ui / base / x / x11_menu_list.h
blob4e8476aea088b75cf387925d2f459e70522e7586
1 // Copyright (c) 2014 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.
5 #ifndef UI_BASE_X_X11_MENU_LIST_H_
6 #define UI_BASE_X_X11_MENU_LIST_H_
8 #include <vector>
10 #include "base/basictypes.h"
11 #include "ui/base/ui_base_export.h"
12 #include "ui/gfx/x/x11_types.h"
14 typedef unsigned long Atom;
16 // A process wide singleton cache for X menus.
17 template <typename T> struct DefaultSingletonTraits;
19 namespace ui {
21 // Keeps track of created and destroyed top level menu windows.
22 class UI_BASE_EXPORT XMenuList {
23 public:
24 static XMenuList* GetInstance();
26 // Checks if |menu| has _NET_WM_WINDOW_TYPE property set to
27 // "_NET_WM_WINDOW_TYPE_MENU" atom and if so caches it.
28 void MaybeRegisterMenu(XID menu);
30 // Finds |menu| in cache and if found removes it.
31 void MaybeUnregisterMenu(XID menu);
33 // Inserts cached menu XIDs at the beginning of |stack|.
34 void InsertMenuWindowXIDs(std::vector<XID>* stack);
36 private:
37 friend struct DefaultSingletonTraits<XMenuList>;
38 XMenuList();
39 ~XMenuList();
41 std::vector<XID> menus_;
42 ::Atom menu_type_atom_;
43 DISALLOW_COPY_AND_ASSIGN(XMenuList);
46 } // namespace ui
48 #endif // UI_BASE_X_X11_MENU_LIST_H_