| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/extensions/api/input_ime/input_ime_api.h" | 5 #include "chrome/browser/extensions/api/input_ime/input_ime_api.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 return; | 210 return; |
| 211 extensions::ProcessManager* process_manager = | 211 extensions::ProcessManager* process_manager = |
| 212 extensions::ProcessManager::Get(profile_); | 212 extensions::ProcessManager::Get(profile_); |
| 213 if (extensions::BackgroundInfo::HasBackgroundPage(extension) && | 213 if (extensions::BackgroundInfo::HasBackgroundPage(extension) && |
| 214 !process_manager->GetBackgroundHostForExtension(extension_id_)) { | 214 !process_manager->GetBackgroundHostForExtension(extension_id_)) { |
| 215 return; | 215 return; |
| 216 } | 216 } |
| 217 } | 217 } |
| 218 } | 218 } |
| 219 | 219 |
| 220 std::unique_ptr<extensions::Event> event( | 220 auto event = base::MakeUnique<extensions::Event>( |
| 221 new extensions::Event(histogram_value, event_name, std::move(args))); | 221 histogram_value, event_name, std::move(args), profile_); |
| 222 event->restrict_to_browser_context = profile_; | |
| 223 extensions::EventRouter::Get(profile_) | 222 extensions::EventRouter::Get(profile_) |
| 224 ->DispatchEventToExtension(extension_id_, std::move(event)); | 223 ->DispatchEventToExtension(extension_id_, std::move(event)); |
| 225 } | 224 } |
| 226 | 225 |
| 227 // The component IME extensions need to know the current screen type (e.g. | 226 // The component IME extensions need to know the current screen type (e.g. |
| 228 // lock screen, login screen, etc.) so that its on-screen keyboard page | 227 // lock screen, login screen, etc.) so that its on-screen keyboard page |
| 229 // won't open new windows/pages. See crbug.com/395621. | 228 // won't open new windows/pages. See crbug.com/395621. |
| 230 std::string GetCurrentScreenType() override { | 229 std::string GetCurrentScreenType() override { |
| 231 switch (chromeos::input_method::InputMethodManager::Get() | 230 switch (chromeos::input_method::InputMethodManager::Get() |
| 232 ->GetUISessionState()) { | 231 ->GetUISessionState()) { |
| (...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 return; | 643 return; |
| 645 InputMethodEngine* engine = | 644 InputMethodEngine* engine = |
| 646 GetActiveEngine(Profile::FromBrowserContext(details.browser_context), | 645 GetActiveEngine(Profile::FromBrowserContext(details.browser_context), |
| 647 details.extension_id); | 646 details.extension_id); |
| 648 // Notifies the IME extension for IME ready with onActivate/onFocus events. | 647 // Notifies the IME extension for IME ready with onActivate/onFocus events. |
| 649 if (engine) | 648 if (engine) |
| 650 engine->Enable(engine->GetActiveComponentId()); | 649 engine->Enable(engine->GetActiveComponentId()); |
| 651 } | 650 } |
| 652 | 651 |
| 653 } // namespace extensions | 652 } // namespace extensions |
| OLD | NEW |