| OLD | NEW |
| 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 "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/values.h" | 10 #include "base/values.h" |
| 11 #include "chrome/browser/chromeos/extensions/input_method_api.h" | 11 #include "chrome/browser/chromeos/extensions/input_method_api.h" |
| 12 #include "chrome/browser/chromeos/web_socket_proxy_controller.h" | |
| 13 #include "chrome/browser/extensions/event_names.h" | 12 #include "chrome/browser/extensions/event_names.h" |
| 14 #include "chrome/browser/extensions/event_router.h" | 13 #include "chrome/browser/extensions/event_router.h" |
| 15 #include "chrome/browser/extensions/extension_system.h" | 14 #include "chrome/browser/extensions/extension_system.h" |
| 16 #include "chrome/browser/profiles/profile_manager.h" | 15 #include "chrome/browser/profiles/profile_manager.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 18 | 17 |
| 19 namespace chromeos { | 18 namespace chromeos { |
| 20 | 19 |
| 21 ExtensionInputMethodEventRouter::ExtensionInputMethodEventRouter() { | 20 ExtensionInputMethodEventRouter::ExtensionInputMethodEventRouter() { |
| 22 input_method::InputMethodManager::Get()->AddObserver(this); | 21 input_method::InputMethodManager::Get()->AddObserver(this); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 44 | 43 |
| 45 // The router will only send the event to extensions that are listening. | 44 // The router will only send the event to extensions that are listening. |
| 46 scoped_ptr<extensions::Event> event(new extensions::Event( | 45 scoped_ptr<extensions::Event> event(new extensions::Event( |
| 47 extensions::event_names::kOnInputMethodChanged, args.Pass())); | 46 extensions::event_names::kOnInputMethodChanged, args.Pass())); |
| 48 event->restrict_to_profile = profile; | 47 event->restrict_to_profile = profile; |
| 49 extensions::ExtensionSystem::Get(profile)->event_router()-> | 48 extensions::ExtensionSystem::Get(profile)->event_router()-> |
| 50 BroadcastEvent(event.Pass()); | 49 BroadcastEvent(event.Pass()); |
| 51 } | 50 } |
| 52 | 51 |
| 53 } // namespace chromeos | 52 } // namespace chromeos |
| OLD | NEW |