OLD | NEW |
1 #!mojo mojo:js_content_handler | 1 #!mojo mojo:js_content_handler |
2 // Demonstrate using the mojo window_manager application to "embed" a view that | 2 // Demonstrate using the mojo window_manager application to "embed" a view that |
3 // displays an image. To run this application set BUILD_DIR to the build | 3 // displays an image. To run this application set BUILD_DIR to the build |
4 // directory (like "src/out/Debug") and append a PNG image URL as the url | 4 // directory (like "src/out/Debug") and append a PNG image URL as the url |
5 // paramaeter for: absolute path for this directory, then: | 5 // paramaeter for: absolute path for this directory, then: |
6 // sky/tools/skydb start $BUILD_DIR examples/js/show_image.js?url=<PNG URL> | 6 // sky/tools/mojodb start $BUILD_DIR examples/js/show_image.js?url=<PNG URL> |
7 // The skydb application starts an HTTP server that points at the build and | 7 // The mojodb application starts an HTTP server that points at the build and |
8 // and source directories. It starts a simple - just one view - window manager | 8 // and source directories. It starts a simple - just one view - window manager |
9 // and then embeds this application in its root view. This application just | 9 // and then embeds this application in its root view. This application just |
10 // asks the same window manager to embed the PNG viewer. Doing so effectively | 10 // asks the same window manager to embed the PNG viewer. Doing so effectively |
11 // removes this application from the window manager's root view. | 11 // removes this application from the window manager's root view. |
12 | 12 |
13 define("main", [ | 13 define("main", [ |
14 "mojo/services/public/js/application", | 14 "mojo/services/public/js/application", |
15 "mojo/services/public/js/service_provider", | 15 "mojo/services/public/js/service_provider", |
16 "mojo/services/window_manager/public/interfaces/window_manager.mojom", | 16 "mojo/services/window_manager/public/interfaces/window_manager.mojom", |
17 "third_party/js/url", | 17 "third_party/js/url", |
(...skipping 15 matching lines...) Expand all Loading... |
33 | 33 |
34 // Displaying imageURL is now the responsibility of the Mojo application | 34 // Displaying imageURL is now the responsibility of the Mojo application |
35 // launched by its content handler. We're done. | 35 // launched by its content handler. We're done. |
36 this.quit(); | 36 this.quit(); |
37 } | 37 } |
38 } | 38 } |
39 | 39 |
40 return ShowImage; | 40 return ShowImage; |
41 }); | 41 }); |
42 | 42 |
OLD | NEW |