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

Side by Side Diff: chrome/browser/ui/webui/mojo_web_ui_controller.h

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 #ifndef CHROME_BROWSER_UI_WEBUI_MOJO_WEB_UI_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_WEBUI_MOJO_WEB_UI_CONTROLLER_H_
7
8 #include <string>
9
10 #include "base/memory/scoped_ptr.h"
11 #include "content/public/browser/web_ui_controller.h"
12 #include "mojo/public/cpp/system/core.h"
13
14 class MojoWebUIHandler;
15
16 namespace content {
17 class WebUIDataSource;
18 }
19
20 // MojoWebUIController is intended for web ui pages that use mojo. It is
21 // expected that subclasses will do two things:
22 // . In the constructor invoke AddMojoResourcePath() to register the bindings
23 // files, eg:
24 // AddMojoResourcePath("chrome/browser/ui/webui/omnibox/omnibox.mojom",
25 // IDR_OMNIBOX_MOJO_JS);
26 // . Override CreateUIHandler() to create the implementation of the bindings.
27 class MojoWebUIController : public content::WebUIController {
28 public:
29 explicit MojoWebUIController(content::WebUI* contents);
30 virtual ~MojoWebUIController();
31
32 // WebUIController overrides:
33 virtual void RenderViewCreated(
34 content::RenderViewHost* render_view_host) OVERRIDE;
35
36 protected:
37 // Invoke to register mapping between binding file and resource id (IDR_...).
38 void AddMojoResourcePath(const std::string& path, int resource_id);
39
40 // Invoked to create the specific bindings implementation.
41 virtual scoped_ptr<MojoWebUIHandler> CreateUIHandler(
42 mojo::ScopedMessagePipeHandle handle_to_page) = 0;
43
44 private:
45 // Bindings files are registered here.
46 content::WebUIDataSource* mojo_data_source_;
47
48 scoped_ptr<MojoWebUIHandler> ui_handler_;
49
50 DISALLOW_COPY_AND_ASSIGN(MojoWebUIController);
51 };
52
53 #endif // CHROME_BROWSER_UI_WEBUI_MOJO_WEB_UI_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/resources/omnibox/omnibox.js ('k') | chrome/browser/ui/webui/mojo_web_ui_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698