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

Unified Diff: ui/events/keycodes/dom4/keycode_converter.h

Issue 494813002: events: keycodes: Remove the stateless singleton instance of KeycodeConverter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/events/event_unittest.cc ('k') | ui/events/keycodes/dom4/keycode_converter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/events/keycodes/dom4/keycode_converter.h
diff --git a/ui/events/keycodes/dom4/keycode_converter.h b/ui/events/keycodes/dom4/keycode_converter.h
index df64a18f12d6afcb1efc5563de61922942086a0f..a52d086e8de53ce156eb78b21cec5b37b8fbdba7 100644
--- a/ui/events/keycodes/dom4/keycode_converter.h
+++ b/ui/events/keycodes/dom4/keycode_converter.h
@@ -7,7 +7,6 @@
#include <stdint.h>
#include "base/basictypes.h"
-#include "base/memory/singleton.h"
// For reference, the W3C UI Event spec is located at:
// http://www.w3.org/TR/uievents/
@@ -38,50 +37,45 @@ typedef struct {
// spec (http://www.w3.org/TR/uievents/).
class KeycodeConverter {
public:
- static KeycodeConverter* GetInstance();
-
// Return the value that identifies an invalid native keycode.
- uint16_t InvalidNativeKeycode();
+ static uint16_t InvalidNativeKeycode();
// Return the string that indentifies an invalid UI Event |code|.
// The returned pointer references a static global string.
- const char* InvalidKeyboardEventCode();
+ static const char* InvalidKeyboardEventCode();
// Convert a native (Mac/Win/Linux) keycode into the |code| string.
// The returned pointer references a static global string.
- const char* NativeKeycodeToCode(uint16_t native_keycode);
+ static const char* NativeKeycodeToCode(uint16_t native_keycode);
// Convert a UI Events |code| string value into a native keycode.
- uint16_t CodeToNativeKeycode(const char* code);
+ static uint16_t CodeToNativeKeycode(const char* code);
// The following methods relate to USB keycodes.
// Note that USB keycodes are not part of any web standard.
// Please don't use USB keycodes in new code.
// Return the value that identifies an invalid USB keycode.
- uint16_t InvalidUsbKeycode();
+ static uint16_t InvalidUsbKeycode();
// Convert a USB keycode into an equivalent platform native keycode.
- uint16_t UsbKeycodeToNativeKeycode(uint32_t usb_keycode);
+ static uint16_t UsbKeycodeToNativeKeycode(uint32_t usb_keycode);
// Convert a platform native keycode into an equivalent USB keycode.
- uint32_t NativeKeycodeToUsbKeycode(uint16_t native_keycode);
+ static uint32_t NativeKeycodeToUsbKeycode(uint16_t native_keycode);
// Convert a USB keycode into the string with the DOM3 |code| value.
// The returned pointer references a static global string.
- const char* UsbKeycodeToCode(uint32_t usb_keycode);
+ static const char* UsbKeycodeToCode(uint32_t usb_keycode);
// Convert a DOM3 Event |code| string into a USB keycode value.
- uint32_t CodeToUsbKeycode(const char* code);
+ static uint32_t CodeToUsbKeycode(const char* code);
// Static methods to support testing.
- size_t NumKeycodeMapEntriesForTest();
- const KeycodeMapEntry* GetKeycodeMapForTest();
+ static size_t NumKeycodeMapEntriesForTest();
+ static const KeycodeMapEntry* GetKeycodeMapForTest();
private:
- KeycodeConverter();
- friend struct DefaultSingletonTraits<KeycodeConverter>;
-
DISALLOW_COPY_AND_ASSIGN(KeycodeConverter);
};
« no previous file with comments | « ui/events/event_unittest.cc ('k') | ui/events/keycodes/dom4/keycode_converter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698