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

Side by Side Diff: chrome/browser/ui/webui/mojo_web_ui_controller.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, 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/webui/mojo_web_ui_controller.h"
6
7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/webui/mojo_web_ui_handler.h"
9 #include "content/public/browser/render_view_host.h"
10 #include "content/public/browser/web_ui_data_source.h"
11 #include "content/public/common/bindings_policy.h"
12 #include "mojo/public/cpp/bindings/interface.h"
13
14 MojoWebUIController::MojoWebUIController(content::WebUI* contents)
15 : WebUIController(contents),
16 mojo_data_source_(NULL) {
17 }
18
19 MojoWebUIController::~MojoWebUIController() {
20 }
21
22 void MojoWebUIController::RenderViewCreated(
23 content::RenderViewHost* render_view_host) {
24 render_view_host->AllowBindings(content::BINDINGS_POLICY_WEB_UI);
25
26 mojo::InterfacePipe<mojo::AnyInterface, mojo::AnyInterface> pipe;
27 ui_handler_ = CreateUIHandler(pipe.handle_to_peer.Pass());
28 render_view_host->SetWebUIHandle(pipe.handle_to_self.Pass());
29 }
30
31 void MojoWebUIController::AddMojoResourcePath(const std::string& path,
32 int resource_id) {
33 if (!mojo_data_source_) {
34 mojo_data_source_ = content::WebUIDataSource::AddMojoDataSource(
35 Profile::FromWebUI(web_ui()));
36 }
37 mojo_data_source_->AddResourcePath(path, resource_id);
38 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/mojo_web_ui_controller.h ('k') | chrome/browser/ui/webui/mojo_web_ui_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698