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

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

Issue 1201063002: Set up the infrastructure for Extension event metrics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaaaaase Created 5 years, 6 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 #include "chrome/browser/chromeos/extensions/input_method_event_router.h" 5 #include "chrome/browser/chromeos/extensions/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/values.h" 10 #include "base/values.h"
(...skipping 30 matching lines...) Expand all
41 } 41 }
42 42
43 scoped_ptr<base::ListValue> args(new base::ListValue()); 43 scoped_ptr<base::ListValue> args(new base::ListValue());
44 base::StringValue* input_method_name = 44 base::StringValue* input_method_name =
45 new base::StringValue(extensions::InputMethodAPI::GetInputMethodForXkb( 45 new base::StringValue(extensions::InputMethodAPI::GetInputMethodForXkb(
46 manager->GetActiveIMEState()->GetCurrentInputMethod().id())); 46 manager->GetActiveIMEState()->GetCurrentInputMethod().id()));
47 args->Append(input_method_name); 47 args->Append(input_method_name);
48 48
49 // The router will only send the event to extensions that are listening. 49 // The router will only send the event to extensions that are listening.
50 scoped_ptr<extensions::Event> event(new extensions::Event( 50 scoped_ptr<extensions::Event> event(new extensions::Event(
51 extensions::events::UNKNOWN,
51 extensions::InputMethodAPI::kOnInputMethodChanged, args.Pass())); 52 extensions::InputMethodAPI::kOnInputMethodChanged, args.Pass()));
52 event->restrict_to_browser_context = context_; 53 event->restrict_to_browser_context = context_;
53 router->BroadcastEvent(event.Pass()); 54 router->BroadcastEvent(event.Pass());
54 } 55 }
55 56
56 } // namespace chromeos 57 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698