OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_CHROME_BROWSER_UI_WEBUI_MOJO_WEB_UI_IOS_CONTROLLER_H_ | 5 #ifndef IOS_CHROME_BROWSER_UI_WEBUI_MOJO_WEB_UI_IOS_CONTROLLER_H_ |
6 #define IOS_CHROME_BROWSER_UI_WEBUI_MOJO_WEB_UI_IOS_CONTROLLER_H_ | 6 #define IOS_CHROME_BROWSER_UI_WEBUI_MOJO_WEB_UI_IOS_CONTROLLER_H_ |
7 | 7 |
8 #import "ios/web/public/web_state/web_state.h" | 8 #import "ios/web/public/web_state/web_state.h" |
9 #include "ios/web/public/webui/web_ui_ios.h" | 9 #include "ios/web/public/webui/web_ui_ios.h" |
10 #include "ios/web/public/webui/web_ui_ios_controller.h" | 10 #include "ios/web/public/webui/web_ui_ios_controller.h" |
11 #include "services/shell/public/cpp/interface_factory.h" | 11 #include "services/service_manager/public/cpp/interface_factory.h" |
12 #include "services/shell/public/cpp/interface_registry.h" | 12 #include "services/service_manager/public/cpp/interface_registry.h" |
13 | 13 |
14 // This class is intended for web ui pages that use mojo. It is expected that | 14 // This class is intended for web ui pages that use mojo. It is expected that |
15 // subclasses will do two things: | 15 // subclasses will do two things: |
16 // . In the constructor invoke AddMojoResourcePath() to register the bindings | 16 // . In the constructor invoke AddMojoResourcePath() to register the bindings |
17 // files, eg: | 17 // files, eg: |
18 // AddMojoResourcePath("chrome/browser/ui/webui/version.mojom", | 18 // AddMojoResourcePath("chrome/browser/ui/webui/version.mojom", |
19 // IDR_IOS_VERSION_MOJO_JS); | 19 // IDR_IOS_VERSION_MOJO_JS); |
20 // . Override BindUIHandler() to create and bind the implementation of the | 20 // . Override BindUIHandler() to create and bind the implementation of the |
21 // bindings. | 21 // bindings. |
22 template <typename Interface> | 22 template <typename Interface> |
(...skipping 14 matching lines...) Expand all Loading... |
37 void Create(const shell::Identity& remote_identity, | 37 void Create(const shell::Identity& remote_identity, |
38 mojo::InterfaceRequest<Interface> request) override { | 38 mojo::InterfaceRequest<Interface> request) override { |
39 BindUIHandler(std::move(request)); | 39 BindUIHandler(std::move(request)); |
40 } | 40 } |
41 | 41 |
42 private: | 42 private: |
43 DISALLOW_COPY_AND_ASSIGN(MojoWebUIIOSController); | 43 DISALLOW_COPY_AND_ASSIGN(MojoWebUIIOSController); |
44 }; | 44 }; |
45 | 45 |
46 #endif // IOS_CHROME_BROWSER_UI_WEBUI_MOJO_WEB_UI_IOS_CONTROLLER_H_ | 46 #endif // IOS_CHROME_BROWSER_UI_WEBUI_MOJO_WEB_UI_IOS_CONTROLLER_H_ |
OLD | NEW |