| OLD | NEW |
| 1 // Copyright (c) 2012 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 CHROME_COMMON_SEARCH_PROVIDER_H_ | 5 module chrome.mojom; |
| 6 #define CHROME_COMMON_SEARCH_PROVIDER_H_ | |
| 7 | 6 |
| 8 namespace search_provider { | 7 import "url/mojo/url.mojom"; |
| 9 | |
| 10 // The type of OSDD that the renderer is giving to the browser. | |
| 11 enum OSDDType { | |
| 12 // The Open Search Description URL was detected automatically. | |
| 13 AUTODETECTED_PROVIDER, | |
| 14 | |
| 15 // The Open Search Description URL was given by Javascript. | |
| 16 EXPLICIT_PROVIDER, | |
| 17 OSDD_TYPE_LAST = EXPLICIT_PROVIDER | |
| 18 }; | |
| 19 | 8 |
| 20 // The install state of the search provider (not installed, installed, default). | 9 // The install state of the search provider (not installed, installed, default). |
| 21 enum InstallState { | 10 enum InstallState { |
| 22 // Equates to an access denied error. | 11 // Equates to an access denied error. |
| 23 DENIED = -1, | 12 DENIED = -1, |
| 24 | 13 |
| 25 // DON'T CHANGE THE VALUES BELOW. | 14 // DON'T CHANGE THE VALUES BELOW. |
| 26 // All of the following values are manidated by the | 15 // All of the following values are manidated by the |
| 27 // spec for window.external.IsSearchProviderInstalled. | 16 // spec for window.external.IsSearchProviderInstalled. |
| 28 | 17 |
| 29 // The search provider is not installed. | 18 // The search provider is not installed. |
| 30 NOT_INSTALLED = 0, | 19 NOT_INSTALLED = 0, |
| 31 | 20 |
| 32 // The search provider is in the user's set but is not | 21 // The search provider is in the user's set but is not |
| 33 INSTALLED_BUT_NOT_DEFAULT = 1, | 22 INSTALLED_BUT_NOT_DEFAULT = 1, |
| 34 | 23 |
| 35 // The search provider is set as the user's default. | 24 // The search provider is set as the user's default. |
| 36 INSTALLED_AS_DEFAULT = 2, | 25 INSTALLED_AS_DEFAULT = 2 |
| 37 | |
| 38 INSTALLED_STATE_LAST = INSTALLED_AS_DEFAULT | |
| 39 }; | 26 }; |
| 40 | 27 |
| 41 } // namespace search_provider | 28 interface SearchProviderInstallState { |
| 42 | 29 // Find out if the given url's security origin is installed as a search |
| 43 #endif // CHROME_COMMON_SEARCH_PROVIDER_H_ | 30 // provider. The |page_url| is the requesting page and the |inquiry_url| is |
| 31 // the search provider (e.g. www.google.com), expressed as a security origin |
| 32 // URL. |
| 33 [Sync] |
| 34 GetInstallState( |
| 35 url.mojom.Url page_url, |
| 36 url.mojom.Url inquiry_url) => (InstallState install); |
| 37 }; |
| OLD | NEW |