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

Unified Diff: chrome/browser/ui/ash/chrome_keyboard_ui.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
Index: chrome/browser/ui/ash/chrome_keyboard_ui.cc
diff --git a/chrome/browser/ui/ash/chrome_keyboard_ui.cc b/chrome/browser/ui/ash/chrome_keyboard_ui.cc
index 3c173f88a4d4c5573cbc5cecb133000fab9ef7aa..cf54830c0ca9e762eb8398388a2b1dc98799dffe 100644
--- a/chrome/browser/ui/ash/chrome_keyboard_ui.cc
+++ b/chrome/browser/ui/ash/chrome_keyboard_ui.cc
@@ -98,11 +98,10 @@ class AshKeyboardControllerObserver
new_bounds->SetInteger("height", bounds.height());
event_args->Append(std::move(new_bounds));
- std::unique_ptr<extensions::Event> event(new extensions::Event(
+ auto event = base::MakeUnique<extensions::Event>(
extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_BOUNDS_CHANGED,
virtual_keyboard_private::OnBoundsChanged::kEventName,
- std::move(event_args)));
- event->restrict_to_browser_context = context_;
+ std::move(event_args), context_);
router->BroadcastEvent(std::move(event));
}
@@ -114,11 +113,10 @@ class AshKeyboardControllerObserver
return;
}
- std::unique_ptr<extensions::Event> event(new extensions::Event(
+ auto event = base::MakeUnique<extensions::Event>(
extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_KEYBOARD_CLOSED,
virtual_keyboard_private::OnKeyboardClosed::kEventName,
- base::WrapUnique(new base::ListValue())));
- event->restrict_to_browser_context = context_;
+ base::MakeUnique<base::ListValue>(), context_);
router->BroadcastEvent(std::move(event));
}
@@ -231,11 +229,10 @@ void ChromeKeyboardUI::SetUpdateInputType(ui::TextInputType type) {
TextInputTypeToGeneratedInputTypeEnum(type)));
event_args->Append(std::move(input_context));
- std::unique_ptr<extensions::Event> event(new extensions::Event(
+ auto event = base::MakeUnique<extensions::Event>(
extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED,
virtual_keyboard_private::OnTextInputBoxFocused::kEventName,
- std::move(event_args)));
- event->restrict_to_browser_context = browser_context();
+ std::move(event_args), browser_context());
router->DispatchEventToExtension(kVirtualKeyboardExtensionID,
std::move(event));
}
« no previous file with comments | « chrome/browser/speech/extension_api/tts_extension_api.cc ('k') | extensions/browser/api/app_runtime/app_runtime_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698