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

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

Issue 1587913002: Use common generated file for inputMethodPrivate APIs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/input_method_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/extensions/dictionary_event_router.cc
diff --git a/chrome/browser/chromeos/extensions/dictionary_event_router.cc b/chrome/browser/chromeos/extensions/dictionary_event_router.cc
index 7630ed52e144c5ed813f4bad57914a89aac2e794..5ab4940b762808b2a6912b547a2b20499433c38b 100644
--- a/chrome/browser/chromeos/extensions/dictionary_event_router.cc
+++ b/chrome/browser/chromeos/extensions/dictionary_event_router.cc
@@ -11,10 +11,16 @@
#include "base/values.h"
#include "chrome/browser/chromeos/extensions/input_method_api.h"
#include "chrome/browser/spellchecker/spellcheck_factory.h"
+#include "chrome/common/extensions/api/input_method_private.h"
#include "content/public/browser/browser_context.h"
#include "extensions/browser/event_router.h"
#include "extensions/browser/extension_system.h"
+namespace OnDictionaryChanged =
+ extensions::api::input_method_private::OnDictionaryChanged;
+namespace OnDictionaryLoaded =
+ extensions::api::input_method_private::OnDictionaryLoaded;
+
namespace chromeos {
ExtensionDictionaryEventRouter::ExtensionDictionaryEventRouter(
@@ -39,8 +45,7 @@ void ExtensionDictionaryEventRouter::DispatchLoadedEventIfLoaded() {
return;
extensions::EventRouter* router = extensions::EventRouter::Get(context_);
- if (!router->HasEventListener(
- extensions::InputMethodAPI::kOnDictionaryLoaded)) {
+ if (!router->HasEventListener(OnDictionaryLoaded::kEventName)) {
return;
}
@@ -48,7 +53,7 @@ void ExtensionDictionaryEventRouter::DispatchLoadedEventIfLoaded() {
// The router will only send the event to extensions that are listening.
scoped_ptr<extensions::Event> event(new extensions::Event(
extensions::events::INPUT_METHOD_PRIVATE_ON_DICTIONARY_LOADED,
- extensions::InputMethodAPI::kOnDictionaryLoaded, std::move(args)));
+ OnDictionaryLoaded::kEventName, std::move(args)));
event->restrict_to_browser_context = context_;
router->BroadcastEvent(std::move(event));
}
@@ -62,8 +67,7 @@ void ExtensionDictionaryEventRouter::OnCustomDictionaryChanged(
const SpellcheckCustomDictionary::Change& dictionary_change) {
extensions::EventRouter* router = extensions::EventRouter::Get(context_);
- if (!router->HasEventListener(
- extensions::InputMethodAPI::kOnDictionaryChanged)) {
+ if (!router->HasEventListener(OnDictionaryChanged::kEventName)) {
return;
}
@@ -82,7 +86,7 @@ void ExtensionDictionaryEventRouter::OnCustomDictionaryChanged(
// The router will only send the event to extensions that are listening.
scoped_ptr<extensions::Event> event(new extensions::Event(
extensions::events::INPUT_METHOD_PRIVATE_ON_DICTIONARY_CHANGED,
- extensions::InputMethodAPI::kOnDictionaryChanged, std::move(args)));
+ OnDictionaryChanged::kEventName, std::move(args)));
event->restrict_to_browser_context = context_;
router->BroadcastEvent(std::move(event));
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/input_method_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698