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

Side by Side Diff: ui/base/x/x11_menu_list.h

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
« no previous file with comments | « ui/base/x/x11_foreign_window_manager.cc ('k') | ui/base/x/x11_menu_list.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 (c) 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef UI_BASE_X_X11_MENU_LIST_H_ 5 #ifndef UI_BASE_X_X11_MENU_LIST_H_
6 #define UI_BASE_X_X11_MENU_LIST_H_ 6 #define UI_BASE_X_X11_MENU_LIST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "ui/base/ui_base_export.h" 11 #include "ui/base/ui_base_export.h"
12 #include "ui/gfx/x/x11_types.h" 12 #include "ui/gfx/x/x11_types.h"
13 13
14 // A process wide singleton cache for X menus. 14 // A process wide singleton cache for X menus.
15 namespace base {
15 template <typename T> struct DefaultSingletonTraits; 16 template <typename T> struct DefaultSingletonTraits;
17 }
16 18
17 namespace ui { 19 namespace ui {
18 20
19 // Keeps track of created and destroyed top level menu windows. 21 // Keeps track of created and destroyed top level menu windows.
20 class UI_BASE_EXPORT XMenuList { 22 class UI_BASE_EXPORT XMenuList {
21 public: 23 public:
22 static XMenuList* GetInstance(); 24 static XMenuList* GetInstance();
23 25
24 // Checks if |menu| has _NET_WM_WINDOW_TYPE property set to 26 // Checks if |menu| has _NET_WM_WINDOW_TYPE property set to
25 // "_NET_WM_WINDOW_TYPE_MENU" atom and if so caches it. 27 // "_NET_WM_WINDOW_TYPE_MENU" atom and if so caches it.
26 void MaybeRegisterMenu(XID menu); 28 void MaybeRegisterMenu(XID menu);
27 29
28 // Finds |menu| in cache and if found removes it. 30 // Finds |menu| in cache and if found removes it.
29 void MaybeUnregisterMenu(XID menu); 31 void MaybeUnregisterMenu(XID menu);
30 32
31 // Inserts cached menu XIDs at the beginning of |stack|. 33 // Inserts cached menu XIDs at the beginning of |stack|.
32 void InsertMenuWindowXIDs(std::vector<XID>* stack); 34 void InsertMenuWindowXIDs(std::vector<XID>* stack);
33 35
34 private: 36 private:
35 friend struct DefaultSingletonTraits<XMenuList>; 37 friend struct base::DefaultSingletonTraits<XMenuList>;
36 XMenuList(); 38 XMenuList();
37 ~XMenuList(); 39 ~XMenuList();
38 40
39 std::vector<XID> menus_; 41 std::vector<XID> menus_;
40 XAtom menu_type_atom_; 42 XAtom menu_type_atom_;
41 DISALLOW_COPY_AND_ASSIGN(XMenuList); 43 DISALLOW_COPY_AND_ASSIGN(XMenuList);
42 }; 44 };
43 45
44 } // namespace ui 46 } // namespace ui
45 47
46 #endif // UI_BASE_X_X11_MENU_LIST_H_ 48 #endif // UI_BASE_X_X11_MENU_LIST_H_
OLDNEW
« no previous file with comments | « ui/base/x/x11_foreign_window_manager.cc ('k') | ui/base/x/x11_menu_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698