OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 import "../network/url_loader.mojom" | 5 import "../navigation/navigation.mojom" |
6 | 6 |
7 module mojo.launcher { | 7 module mojo.launcher { |
8 | 8 |
9 [Client=LauncherClient] | 9 [Client=LauncherClient] |
10 interface Launcher { | 10 interface Launcher { |
11 // Determines the correct handler application that can render a given URL. | |
12 // | |
13 // Sometimes this is known statically from the URL (e.g., from its scheme, or | |
14 // because we already have an application locally that has said it can handle | |
15 // the URL. Other times, we will actually fetch |url| to examine its | |
16 // content-type and/or sniff it to determine the correct handler. | |
11 Launch(string url); | 17 Launch(string url); |
12 }; | 18 }; |
13 | 19 |
14 [Client=Launcher] | 20 [Client=Launcher] |
15 interface LauncherClient { | 21 interface LauncherClient { |
16 OnLaunch(string handler_url, mojo.URLResponse response, | 22 // Called when a handler has been resolved in response to Launch(). Receiving |
17 handle<data_pipe_consumer> response_body_stream); | 23 // application should connect to the application at |handler_url| and navigate |
24 // it to |view_url|. | |
25 // | |
26 // Note: |view_url| might not be the same as the URL that was initially | |
27 // requested, e.g., in the case of redirects. Applications should always | |
28 // navigate to view_url, not the initial URL. | |
29 // | |
30 // Note: |response| can be NULL in the case where a request was not needed to | |
31 // determine the correct handler. | |
32 OnLaunch(string handler_url, string view_url, | |
darin (slow to review)
2014/06/20 15:12:37
The final URL of the redirect chain is also stored
Aaron Boodman
2014/06/20 16:09:32
In the case where a request was performed, yes. Bu
| |
33 mojo.navigation.ResponseDetails response); | |
18 }; | 34 }; |
19 | 35 |
20 } | 36 } |
OLD | NEW |