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

Unified Diff: chrome/browser/chromeos/extensions/input_method_event_router.cc

Issue 11442074: Lazy initialization for ExtensionInputMethodEventRouter (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebased Created 8 years 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
Index: chrome/browser/chromeos/extensions/input_method_event_router.cc
diff --git a/chrome/browser/chromeos/extensions/input_method_event_router.cc b/chrome/browser/chromeos/extensions/input_method_event_router.cc
index b7202b8b910dc47d40bff90be651d5bd88bc8da9..b6c070e140f629e1af1f9b8f1783a5b0e49ccbe7 100644
--- a/chrome/browser/chromeos/extensions/input_method_event_router.cc
+++ b/chrome/browser/chromeos/extensions/input_method_event_router.cc
@@ -8,6 +8,7 @@
#include "base/json/json_writer.h"
#include "base/values.h"
+#include "chrome/browser/chromeos/extensions/input_method_api.h"
#include "chrome/browser/chromeos/input_method/input_method_configuration.h"
#include "chrome/browser/chromeos/web_socket_proxy_controller.h"
#include "chrome/browser/extensions/event_names.h"
@@ -16,13 +17,6 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profile.h"
-namespace {
-
-// Prefix, which is used by XKB.
-const char kXkbPrefix[] = "xkb:";
-
-} // namespace
-
namespace chromeos {
ExtensionInputMethodEventRouter::ExtensionInputMethodEventRouter() {
@@ -45,7 +39,8 @@ void ExtensionInputMethodEventRouter::InputMethodChanged(
scoped_ptr<ListValue> args(new ListValue());
StringValue *input_method_name = new StringValue(
- GetInputMethodForXkb(manager->GetCurrentInputMethod().id()));
+ extensions::InputMethodAPI::GetInputMethodForXkb(
+ manager->GetCurrentInputMethod().id()));
args->Append(input_method_name);
// The router will only send the event to extensions that are listening.
@@ -56,11 +51,4 @@ void ExtensionInputMethodEventRouter::InputMethodChanged(
BroadcastEvent(event.Pass());
}
-std::string ExtensionInputMethodEventRouter::GetInputMethodForXkb(
- const std::string& xkb_id) {
- size_t prefix_length = std::string(kXkbPrefix).length();
- DCHECK(xkb_id.substr(0, prefix_length) == kXkbPrefix);
- return xkb_id.substr(prefix_length);
-}
-
} // namespace chromeos
« no previous file with comments | « chrome/browser/chromeos/extensions/input_method_event_router.h ('k') | chrome/browser/extensions/extension_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698