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 module navigation.mojom; | 5 module navigation.mojom; |
6 | 6 |
7 import "components/mus/public/interfaces/window_tree.mojom"; | 7 import "components/mus/public/interfaces/window_tree.mojom"; |
8 import "ui/gfx/geometry/mojo/geometry.mojom"; | 8 import "ui/gfx/geometry/mojo/geometry.mojom"; |
9 import "url/mojo/url.mojom"; | 9 import "url/mojo/url.mojom"; |
10 | 10 |
| 11 // TODO(beng): A general note about structs & methods in this file. |
| 12 // |
| 13 // These types are (for the most part) fairly rote copies of enums, structs & |
| 14 // interfaces from //content/public/browser & friends. |
| 15 // Not a huge amount of thought has been put into which values & methods should |
| 16 // be made available, the emphasis has been on getting a working service up and |
| 17 // running that is useful. It would be worth taking a pass through this set at |
| 18 // some point, condensing it, figuring out how it relates to stuff in |
| 19 // content/public/browser, etc. |
| 20 // |
| 21 // For now, it's duplicated here because this service is still experimental and |
| 22 // I didn't want to disrupt content/public/browser based on an experiment. |
| 23 |
11 // Copied from //content/public/browser/navigation_entry.h | 24 // Copied from //content/public/browser/navigation_entry.h |
12 struct NavigationEntry { | 25 struct NavigationEntry { |
13 int32 id; | 26 int32 id; |
14 url.mojom.Url url; | 27 url.mojom.Url url; |
15 string title; | 28 string title; |
16 array<url.mojom.Url> redirect_chain; | 29 array<url.mojom.Url> redirect_chain; |
17 }; | 30 }; |
18 | 31 |
19 // Copied from //content/public/browser/navigation_type.h | 32 // Copied from //content/public/browser/navigation_type.h |
20 enum NavigationType { | 33 enum NavigationType { |
21 UNKNOWN, | 34 UNKNOWN, |
22 NEW_PAGE, | 35 NEW_PAGE, |
23 EXISTING_PAGE, | 36 EXISTING_PAGE, |
24 SAME_PAGE, | 37 SAME_PAGE, |
25 NEW_SUBFRAME, | 38 NEW_SUBFRAME, |
26 AUTO_SUBFRAME, | 39 AUTO_SUBFRAME, |
27 NAV_IGNORE | 40 NAV_IGNORE |
28 }; | 41 }; |
29 | 42 |
| 43 // Copied from //ui/base/window_open_disposition.h |
| 44 enum WindowOpenDisposition { |
| 45 UNKNOWN, |
| 46 SUPPRESS_OPEN, |
| 47 CURRENT_TAB, |
| 48 SINGLETON_TAB, |
| 49 NEW_FOREGROUND_TAB, |
| 50 NEW_BACKGROUND_TAB, |
| 51 NEW_POPUP, |
| 52 NEW_WINDOW, |
| 53 SAVE_TO_DISK, |
| 54 OFF_THE_RECORD, |
| 55 IGNORE_ACTION, |
| 56 WINDOW_OPEN_DISPOSITION_LAST = IGNORE_ACTION |
| 57 }; |
| 58 |
30 // Copied from //content/public/browser/navigation_details.h | 59 // Copied from //content/public/browser/navigation_details.h |
31 struct NavigationCommittedDetails { | 60 struct NavigationCommittedDetails { |
32 int32 entry; | 61 int32 entry; |
33 NavigationType type; | 62 NavigationType type; |
34 int32 previous_entry_index; | 63 int32 previous_entry_index; |
35 url.mojom.Url previous_url; | 64 url.mojom.Url previous_url; |
36 bool did_replace_entry; | 65 bool did_replace_entry; |
37 bool is_in_page; | 66 bool is_in_page; |
38 bool is_main_frame; | 67 bool is_main_frame; |
39 // SSLStatus ssl_status; | 68 // SSLStatus ssl_status; |
40 int32 http_status_code; | 69 int32 http_status_code; |
41 }; | 70 }; |
42 | 71 |
| 72 // Copied from //content/public/browser/page_navigator.h |
| 73 struct OpenURLParams { |
| 74 url.mojom.Url url; |
| 75 WindowOpenDisposition disposition; |
| 76 }; |
| 77 |
43 interface ViewFactory { | 78 interface ViewFactory { |
44 CreateView(ViewClient client, View& view); | 79 CreateView(ViewClient client, View& view); |
45 }; | 80 }; |
46 | 81 |
47 interface ViewClient { | 82 interface ViewClient { |
| 83 OpenURL(OpenURLParams params); |
48 LoadingStateChanged(bool is_loading); | 84 LoadingStateChanged(bool is_loading); |
49 NavigationStateChanged(url.mojom.Url url, | 85 NavigationStateChanged(url.mojom.Url url, |
50 string title, | 86 string title, |
51 bool can_go_back, | 87 bool can_go_back, |
52 bool can_go_forward); | 88 bool can_go_forward); |
53 LoadProgressChanged(double progress); | 89 LoadProgressChanged(double progress); |
54 UpdateHoverURL(url.mojom.Url url); | 90 UpdateHoverURL(url.mojom.Url url); |
55 | 91 |
56 ViewCreated(View view, | 92 ViewCreated(View view, |
57 ViewClient& client, | 93 ViewClient& client, |
(...skipping 25 matching lines...) Expand all Loading... |
83 // UI. | 119 // UI. |
84 GetWindowTreeClient(mus.mojom.WindowTreeClient& client); | 120 GetWindowTreeClient(mus.mojom.WindowTreeClient& client); |
85 | 121 |
86 ShowInterstitial(string html); | 122 ShowInterstitial(string html); |
87 HideInterstitial(); | 123 HideInterstitial(); |
88 | 124 |
89 // The resize area is a rectangle in the bottom corner of the view that allows | 125 // The resize area is a rectangle in the bottom corner of the view that allows |
90 // the top-level window containing the view to be interactively resized. | 126 // the top-level window containing the view to be interactively resized. |
91 SetResizerSize(gfx.mojom.Size size); | 127 SetResizerSize(gfx.mojom.Size size); |
92 }; | 128 }; |
OLD | NEW |