Chromium Code Reviews| 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 chrome.mojom; | 5 module chrome.mojom; |
| 6 | 6 |
| 7 import "mojo/common/string16.mojom"; | 7 import "mojo/common/string16.mojom"; |
| 8 import "mojo/common/time.mojom"; | 8 import "mojo/common/time.mojom"; |
| 9 import "url/mojo/url.mojom"; | 9 import "url/mojo/url.mojom"; |
| 10 | 10 |
| 11 [Native] | 11 [Native] |
| 12 enum NTPLoggingEventType; | 12 enum NTPLoggingEventType; |
| 13 | 13 |
| 14 [Native] | 14 [Native] |
| 15 enum OmniboxFocusState; | 15 enum OmniboxFocusState; |
| 16 | 16 |
| 17 [Native] | 17 [Native] |
| 18 enum NTPTileSource; | 18 enum NTPTileSource; |
| 19 | 19 |
| 20 // Interface used to connect to the embedded search interface. This is a | |
| 21 // separate interface such that a reverse connection (|client| below) can be | |
| 22 // passed when connecting. | |
| 23 interface EmbeddedSearchConnector { | |
| 24 // Connect to the interface. |instant| is the connection which the client will | |
| 25 // use to query the embedded search interface. |client| is the connection used | |
| 26 // by the embedded search interface implementation to push browser state | |
| 27 // updates to the client. | |
| 28 Connect(associated Instant& instant, associated SearchBox client); | |
| 29 }; | |
| 30 | |
| 31 // TODO(tibell): Rename this to EmbeddedSearch. | |
| 32 // | |
| 33 // Browser interface to support embedded search. Render frames connect to this | |
| 34 // interface to query browser data, such as the most visited pages. | |
| 20 interface Instant { | 35 interface Instant { |
| 21 // Tells InstantExtended whether the embedded search API is supported. | 36 // Tells InstantExtended whether the embedded search API is supported. |
| 22 // See http://dev.chromium.org/embeddedsearch | 37 // See http://dev.chromium.org/embeddedsearch |
| 23 InstantSupportDetermined(int32 page_seq_no, bool result); | 38 InstantSupportDetermined(int32 page_seq_no, bool result); |
| 24 | 39 |
| 25 // Tells InstantExtended to set the omnibox focus state. | 40 // Tells InstantExtended to set the omnibox focus state. |
| 26 FocusOmnibox(int32 page_seq_no, OmniboxFocusState state); | 41 FocusOmnibox(int32 page_seq_no, OmniboxFocusState state); |
| 27 | 42 |
| 28 // TODO(treib): Remove the SearchBox prefix from these three methods. | 43 // TODO(treib): Remove the SearchBox prefix from these three methods. |
| 29 // Tells InstantExtended to delete a most visited item. | 44 // Tells InstantExtended to delete a most visited item. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 | 86 |
| 72 [Native] | 87 [Native] |
| 73 struct InstantSuggestion; | 88 struct InstantSuggestion; |
| 74 | 89 |
| 75 [Native] | 90 [Native] |
| 76 struct EmbeddedSearchRequestParams; | 91 struct EmbeddedSearchRequestParams; |
| 77 | 92 |
| 78 [Native] | 93 [Native] |
| 79 struct ThemeBackgroundInfo; | 94 struct ThemeBackgroundInfo; |
| 80 | 95 |
| 96 // TODO(tibell): Rename this to EmbeddedSearchClient. | |
| 97 // | |
| 98 // Renderer interface used by the browser to push updates to the client. For | |
| 99 // example, the browser will tell the frame if the omnibox got focus. | |
| 81 interface SearchBox { | 100 interface SearchBox { |
| 82 SetPageSequenceNumber(int32 page_seq_no); | 101 SetPageSequenceNumber(int32 page_seq_no); |
| 83 | 102 |
| 84 DetermineIfPageSupportsInstant(); | 103 DetermineIfPageSupportsInstant(); |
| 85 | 104 |
| 86 FocusChanged(OmniboxFocusState new_focus_state, | 105 FocusChanged(OmniboxFocusState new_focus_state, |
| 87 OmniboxFocusChangeReason reason); | 106 OmniboxFocusChangeReason reason); |
| 88 | 107 |
| 89 MostVisitedChanged(array<InstantMostVisitedItem> items); | 108 MostVisitedChanged(array<InstantMostVisitedItem> items); |
| 90 | 109 |
| 91 SetInputInProgress(bool input_in_progress); | 110 SetInputInProgress(bool input_in_progress); |
| 92 | 111 |
| 93 SetSuggestionToPrefetch(InstantSuggestion suggestion); | 112 SetSuggestionToPrefetch(InstantSuggestion suggestion); |
| 94 | 113 |
| 95 Submit(mojo.common.mojom.String16 value, | 114 Submit(mojo.common.mojom.String16 value, |
| 96 EmbeddedSearchRequestParams params); | 115 EmbeddedSearchRequestParams params); |
| 97 | 116 |
| 98 ThemeChanged(ThemeBackgroundInfo value); | 117 ThemeChanged(ThemeBackgroundInfo value); |
| 99 | 118 |
| 119 // TODO(treib): Remove the *Result methods and instead add return values to | |
| 120 // the correspnding methods in the Instant interface above. | |
|
Marc Treib
2017/02/09 09:30:47
Ah, is this something made possible by Mojo? Nice!
tibell
2017/02/09 22:32:01
Yup! It's convenient and also removes the need to
| |
| 100 HistorySyncCheckResult(bool sync_history); | 121 HistorySyncCheckResult(bool sync_history); |
| 101 | 122 |
| 102 ChromeIdentityCheckResult(mojo.common.mojom.String16 identity, | 123 ChromeIdentityCheckResult(mojo.common.mojom.String16 identity, |
| 103 bool identity_match); | 124 bool identity_match); |
| 104 }; | 125 }; |
| OLD | NEW |