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

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

Issue 2898383002: [Extensions] Make Event::restrict_to_browser_context const. (Closed)
Patch Set: sync @tott Created 3 years, 7 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/ime_menu_event_router.cc » ('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 7ee32c89eac1af67ce5103bb0901ea448a3e867b..f04d45fcaf4a6a5a91711b8de21f1aead3981d7c 100644
--- a/chrome/browser/chromeos/extensions/dictionary_event_router.cc
+++ b/chrome/browser/chromeos/extensions/dictionary_event_router.cc
@@ -8,6 +8,7 @@
#include <utility>
#include "base/json/json_writer.h"
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "chrome/browser/chromeos/extensions/input_method_api.h"
#include "chrome/browser/spellchecker/spellcheck_factory.h"
@@ -49,12 +50,11 @@ void ExtensionDictionaryEventRouter::DispatchLoadedEventIfLoaded() {
return;
}
- std::unique_ptr<base::ListValue> args(new base::ListValue());
// The router will only send the event to extensions that are listening.
- std::unique_ptr<extensions::Event> event(new extensions::Event(
+ auto event = base::MakeUnique<extensions::Event>(
extensions::events::INPUT_METHOD_PRIVATE_ON_DICTIONARY_LOADED,
- OnDictionaryLoaded::kEventName, std::move(args)));
- event->restrict_to_browser_context = context_;
+ OnDictionaryLoaded::kEventName, base::MakeUnique<base::ListValue>(),
+ context_);
router->BroadcastEvent(std::move(event));
}
@@ -84,10 +84,9 @@ void ExtensionDictionaryEventRouter::OnCustomDictionaryChanged(
args->Append(std::move(removed_words));
// The router will only send the event to extensions that are listening.
- std::unique_ptr<extensions::Event> event(new extensions::Event(
+ auto event = base::MakeUnique<extensions::Event>(
extensions::events::INPUT_METHOD_PRIVATE_ON_DICTIONARY_CHANGED,
- OnDictionaryChanged::kEventName, std::move(args)));
- event->restrict_to_browser_context = context_;
+ OnDictionaryChanged::kEventName, std::move(args), context_);
router->BroadcastEvent(std::move(event));
}
« no previous file with comments | « no previous file | chrome/browser/chromeos/extensions/ime_menu_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698