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

Side by Side Diff: chrome/browser/chromeos/extensions/input_method_event_router.cc

Issue 7649006: more changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another typo Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "input_method_event_router.h" 5 #include "input_method_event_router.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 const input_method::InputMethodDescriptor &current_input_method, 67 const input_method::InputMethodDescriptor &current_input_method,
68 size_t num_active_input_methods) { 68 size_t num_active_input_methods) {
69 Profile *profile = ProfileManager::GetDefaultProfile(); 69 Profile *profile = ProfileManager::GetDefaultProfile();
70 ExtensionEventRouter *router = profile->GetExtensionEventRouter(); 70 ExtensionEventRouter *router = profile->GetExtensionEventRouter();
71 71
72 if (!router->HasEventListener(extension_event_names::kOnInputMethodChanged)) 72 if (!router->HasEventListener(extension_event_names::kOnInputMethodChanged))
73 return; 73 return;
74 74
75 ListValue args; 75 ListValue args;
76 StringValue *input_method_name = 76 StringValue *input_method_name =
77 new StringValue(GetInputMethodForXkb(current_input_method.id())); 77 base::StringValue::New(GetInputMethodForXkb(current_input_method.id()));
78 args.Append(input_method_name); 78 args.Append(input_method_name);
79 std::string args_json; 79 std::string args_json;
80 base::JSONWriter::Write(&args, false, &args_json); 80 base::JSONWriter::Write(&args, false, &args_json);
81 81
82 const std::vector<std::string>& ids = 82 const std::vector<std::string>& ids =
83 g_input_method_private_extensions_whitelist.Get().ids(); 83 g_input_method_private_extensions_whitelist.Get().ids();
84 84
85 for (size_t i = 0; i < ids.size(); ++i) { 85 for (size_t i = 0; i < ids.size(); ++i) {
86 // ExtensionEventRoutner will check that the extension is listening for the 86 // ExtensionEventRoutner will check that the extension is listening for the
87 // event. 87 // event.
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return xkb_id.substr(prefix_length); 120 return xkb_id.substr(prefix_length);
121 } 121 }
122 122
123 // static 123 // static
124 bool ExtensionInputMethodEventRouter::IsExtensionWhitelisted( 124 bool ExtensionInputMethodEventRouter::IsExtensionWhitelisted(
125 const std::string& extension_id) { 125 const std::string& extension_id) {
126 return g_input_method_private_extensions_whitelist.Get().HasId(extension_id); 126 return g_input_method_private_extensions_whitelist.Get().HasId(extension_id);
127 } 127 }
128 128
129 } // namespace chromeos 129 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros_settings.cc ('k') | chrome/browser/chromeos/login/signed_settings_temp_storage.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698