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

Side by Side Diff: chrome/browser/chromeos/events/system_key_event_listener.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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 CHROME_BROWSER_CHROMEOS_EVENTS_SYSTEM_KEY_EVENT_LISTENER_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_EVENTS_SYSTEM_KEY_EVENT_LISTENER_H_
6 #define CHROME_BROWSER_CHROMEOS_EVENTS_SYSTEM_KEY_EVENT_LISTENER_H_ 6 #define CHROME_BROWSER_CHROMEOS_EVENTS_SYSTEM_KEY_EVENT_LISTENER_H_
7 7
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "ui/events/platform/platform_event_observer.h" 9 #include "ui/events/platform/platform_event_observer.h"
10 10
11 typedef union _XEvent XEvent; 11 typedef union _XEvent XEvent;
12 12
13 namespace chromeos { 13 namespace chromeos {
14 14
15 class SystemKeyEventListener : public ui::PlatformEventObserver { 15 class SystemKeyEventListener : public ui::PlatformEventObserver {
16 public: 16 public:
17 static void Initialize(); 17 static void Initialize();
18 static void Shutdown(); 18 static void Shutdown();
19 // GetInstance returns NULL if not initialized or if already shutdown. 19 // GetInstance returns NULL if not initialized or if already shutdown.
20 static SystemKeyEventListener* GetInstance(); 20 static SystemKeyEventListener* GetInstance();
21 21
22 void Stop(); 22 void Stop();
23 23
24 private: 24 private:
25 // Defines the delete on exit Singleton traits we like. Best to have this 25 // Defines the delete on exit Singleton traits we like. Best to have this
26 // and const/dest private as recommended for Singletons. 26 // and const/dest private as recommended for Singletons.
27 friend struct DefaultSingletonTraits<SystemKeyEventListener>; 27 friend struct base::DefaultSingletonTraits<SystemKeyEventListener>;
28 friend class SystemKeyEventListenerTest; 28 friend class SystemKeyEventListenerTest;
29 29
30 SystemKeyEventListener(); 30 SystemKeyEventListener();
31 ~SystemKeyEventListener() override; 31 ~SystemKeyEventListener() override;
32 32
33 // ui::PlatformEventObserver: 33 // ui::PlatformEventObserver:
34 void WillProcessEvent(const ui::PlatformEvent& event) override; 34 void WillProcessEvent(const ui::PlatformEvent& event) override;
35 void DidProcessEvent(const ui::PlatformEvent& event) override; 35 void DidProcessEvent(const ui::PlatformEvent& event) override;
36 36
37 void ProcessedXEvent(XEvent* xevent); 37 void ProcessedXEvent(XEvent* xevent);
38 38
39 bool stopped_; 39 bool stopped_;
40 40
41 // Base X ID for events from the XKB extension. 41 // Base X ID for events from the XKB extension.
42 int xkb_event_base_; 42 int xkb_event_base_;
43 43
44 DISALLOW_COPY_AND_ASSIGN(SystemKeyEventListener); 44 DISALLOW_COPY_AND_ASSIGN(SystemKeyEventListener);
45 }; 45 };
46 46
47 } // namespace chromeos 47 } // namespace chromeos
48 48
49 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_SYSTEM_KEY_EVENT_LISTENER_H_ 49 #endif // CHROME_BROWSER_CHROMEOS_EVENTS_SYSTEM_KEY_EVENT_LISTENER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698