| Index: chrome/browser/ui/webui/omnibox/omnibox_ui.cc
|
| diff --git a/chrome/browser/ui/webui/omnibox/omnibox_ui.cc b/chrome/browser/ui/webui/omnibox/omnibox_ui.cc
|
| index d677bebf35e0c1a4688a8f0b85e2746c67352ba4..876b522de1d7f5e22136cb9c5fde4bfb14670d27 100644
|
| --- a/chrome/browser/ui/webui/omnibox/omnibox_ui.cc
|
| +++ b/chrome/browser/ui/webui/omnibox/omnibox_ui.cc
|
| @@ -12,8 +12,7 @@
|
| #include "content/public/browser/web_ui_data_source.h"
|
| #include "grit/browser_resources.h"
|
|
|
| -OmniboxUI::OmniboxUI(content::WebUI* web_ui)
|
| - : content::WebUIController(web_ui) {
|
| +OmniboxUI::OmniboxUI(content::WebUI* web_ui) : MojoWebUIController(web_ui) {
|
| // Set up the chrome://omnibox/ source.
|
| content::WebUIDataSource* html_source =
|
| content::WebUIDataSource::Create(chrome::kChromeUIOmniboxHost);
|
| @@ -21,11 +20,19 @@ OmniboxUI::OmniboxUI(content::WebUI* web_ui)
|
| html_source->AddResourcePath("omnibox.js", IDR_OMNIBOX_JS);
|
| html_source->SetDefaultResource(IDR_OMNIBOX_HTML);
|
|
|
| - Profile* profile = Profile::FromWebUI(web_ui);
|
| - content::WebUIDataSource::Add(profile, html_source);
|
| + content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), html_source);
|
|
|
| - // AddMessageHandler takes ownership of OmniboxUIHandler
|
| - web_ui->AddMessageHandler(new OmniboxUIHandler(profile));
|
| + AddMojoResourcePath("chrome/browser/ui/webui/omnibox/omnibox.mojom",
|
| + IDR_OMNIBOX_MOJO_JS);
|
| }
|
|
|
| -OmniboxUI::~OmniboxUI() { }
|
| +OmniboxUI::~OmniboxUI() {}
|
| +
|
| +scoped_ptr<MojoWebUIHandler> OmniboxUI::CreateUIHandler(
|
| + mojo::ScopedMessagePipeHandle handle_to_page) {
|
| + chrome::ScopedOmniboxPageHandle omnibox_handle(
|
| + chrome::OmniboxPageHandle(handle_to_page.release().value()));
|
| + return scoped_ptr<MojoWebUIHandler>(
|
| + new OmniboxUIHandler(omnibox_handle.Pass(),
|
| + Profile::FromWebUI(web_ui())));
|
| +}
|
|
|