4646class CefSchemeHandler ;
4747class CefSchemeHandlerFactory ;
4848
49- // /
50- // Register a custom scheme. This method should not be called for the built-in
51- // HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
52- //
53- // If |is_standard| is true the scheme will be treated as a standard scheme.
54- // Standard schemes are subject to URL canonicalization and parsing rules as
55- // defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available
56- // at http://www.ietf.org/rfc/rfc1738.txt
57- //
58- // In particular, the syntax for standard scheme URLs must be of the form:
59- // <pre>
60- // [scheme]://[username]:[password]@[host]:[port]/[url-path]
61- // </pre>
62- // Standard scheme URLs must have a host component that is a fully qualified
63- // domain name as defined in Section 3.5 of RFC 1034 [13] and Section 2.1 of RFC
64- // 1123. These URLs will be canonicalized to "scheme://host/path" in the
65- // simplest case and "scheme://username:password@host:port/path" in the most
66- // explicit case. For example, "scheme:host/path" and "scheme:///host/path" will
67- // both be canonicalized to "scheme://host/path". The origin of a standard
68- // scheme URL is the combination of scheme, host and port (i.e.,
69- // "scheme://host:port" in the most explicit case).
70- //
71- // For non-standard scheme URLs only the "scheme:" component is parsed and
72- // canonicalized. The remainder of the URL will be passed to the handler as-is.
73- // For example, "scheme:///some%20text" will remain the same. Non-standard
74- // scheme URLs cannot be used as a target for form submission.
75- //
76- // If |is_local| is true the scheme will be treated as local (i.e., with the
77- // same security rules as those applied to "file" URLs). Normal pages cannot
78- // link to or access local URLs. Also, by default, local URLs can only perform
79- // XMLHttpRequest calls to the same URL (origin + path) that originated the
80- // request. To allow XMLHttpRequest calls from a local URL to other URLs with
81- // the same origin set the CefSettings.file_access_from_file_urls_allowed value
82- // to true. To allow XMLHttpRequest calls from a local URL to all origins set
83- // the CefSettings.universal_access_from_file_urls_allowed value to true.
84- //
85- // If |is_display_isolated| is true the scheme will be treated as display-
86- // isolated. This means that pages cannot display these URLs unless they are
87- // from the same scheme. For example, pages in another origin cannot create
88- // iframes or hyperlinks to URLs with this scheme.
89- //
90- // This function may be called on any thread. It should only be called once
91- // per unique |scheme_name| value. If |scheme_name| is already registered or if
92- // an error occurs this method will return false.
93- // /
94- /* --cef()--*/
95- bool CefRegisterCustomScheme (const CefString& scheme_name,
96- bool is_standard,
97- bool is_local,
98- bool is_display_isolated);
99-
10049// /
10150// Register a scheme handler factory for the specified |scheme_name| and
10251// optional |domain_name|. An empty |domain_name| value for a standard scheme
@@ -122,6 +71,66 @@ bool CefRegisterSchemeHandlerFactory(const CefString& scheme_name,
12271bool CefClearSchemeHandlerFactories ();
12372
12473
74+ // /
75+ // Class that manages custom scheme registrations.
76+ // /
77+ /* --cef(source=library)--*/
78+ class CefSchemeRegistrar : public virtual CefBase {
79+ public:
80+ // /
81+ // Register a custom scheme. This method should not be called for the built-in
82+ // HTTP, HTTPS, FILE, FTP, ABOUT and DATA schemes.
83+ //
84+ // If |is_standard| is true the scheme will be treated as a standard scheme.
85+ // Standard schemes are subject to URL canonicalization and parsing rules as
86+ // defined in the Common Internet Scheme Syntax RFC 1738 Section 3.1 available
87+ // at http://www.ietf.org/rfc/rfc1738.txt
88+ //
89+ // In particular, the syntax for standard scheme URLs must be of the form:
90+ // <pre>
91+ // [scheme]://[username]:[password]@[host]:[port]/[url-path]
92+ // </pre>
93+ // Standard scheme URLs must have a host component that is a fully qualified
94+ // domain name as defined in Section 3.5 of RFC 1034 [13] and Section 2.1 of
95+ // RFC 1123. These URLs will be canonicalized to "scheme://host/path" in the
96+ // simplest case and "scheme://username:password@host:port/path" in the most
97+ // explicit case. For example, "scheme:host/path" and "scheme:///host/path"
98+ // will both be canonicalized to "scheme://host/path". The origin of a
99+ // standard scheme URL is the combination of scheme, host and port (i.e.,
100+ // "scheme://host:port" in the most explicit case).
101+ //
102+ // For non-standard scheme URLs only the "scheme:" component is parsed and
103+ // canonicalized. The remainder of the URL will be passed to the handler
104+ // as-is. For example, "scheme:///some%20text" will remain the same.
105+ // Non-standard scheme URLs cannot be used as a target for form submission.
106+ //
107+ // If |is_local| is true the scheme will be treated as local (i.e., with the
108+ // same security rules as those applied to "file" URLs). Normal pages cannot
109+ // link to or access local URLs. Also, by default, local URLs can only perform
110+ // XMLHttpRequest calls to the same URL (origin + path) that originated the
111+ // request. To allow XMLHttpRequest calls from a local URL to other URLs with
112+ // the same origin set the CefSettings.file_access_from_file_urls_allowed
113+ // value to true. To allow XMLHttpRequest calls from a local URL to all
114+ // origins set the CefSettings.universal_access_from_file_urls_allowed value
115+ // to true.
116+ //
117+ // If |is_display_isolated| is true the scheme will be treated as display-
118+ // isolated. This means that pages cannot display these URLs unless they are
119+ // from the same scheme. For example, pages in another origin cannot create
120+ // iframes or hyperlinks to URLs with this scheme.
121+ //
122+ // This function may be called on any thread. It should only be called once
123+ // per unique |scheme_name| value. If |scheme_name| is already registered or
124+ // if an error occurs this method will return false.
125+ // /
126+ /* --cef()--*/
127+ virtual bool AddCustomScheme (const CefString& scheme_name,
128+ bool is_standard,
129+ bool is_local,
130+ bool is_display_isolated) =0;
131+ };
132+
133+
125134// /
126135// Class that creates CefSchemeHandler instances. The methods of this class will
127136// always be called on the IO thread.
@@ -135,7 +144,7 @@ class CefSchemeHandlerFactory : public virtual CefBase {
135144 // initiated using the CefWebURLRequest API |browser| will be NULL. The
136145 // |request| object passed to this method will not contain cookie data.
137146 // /
138- /* --cef()--*/
147+ /* --cef(optional_param=browser )--*/
139148 virtual CefRefPtr<CefSchemeHandler> Create (CefRefPtr<CefBrowser> browser,
140149 const CefString& scheme_name,
141150 CefRefPtr<CefRequest> request) =0;
0 commit comments