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

Unified Diff: chrome/browser/ui/webui/omnibox/omnibox_ui.cc

Issue 222543004: Makes chrome://omnibox use mojo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get working with mojo changes Created 6 years, 8 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 | « chrome/browser/ui/webui/omnibox/omnibox_ui.h ('k') | chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b288fc34e0d39d1d9370f25e5dbba1d7daf74e78 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,18 @@ 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) {
+ return scoped_ptr<MojoWebUIHandler>(
+ new OmniboxUIHandler(
+ ScopedOmniboxPageHandle::From(handle_to_page.Pass()).Pass(),
+ Profile::FromWebUI(web_ui())));
+}
« no previous file with comments | « chrome/browser/ui/webui/omnibox/omnibox_ui.h ('k') | chrome/browser/ui/webui/omnibox/omnibox_ui_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698