OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 6 #define CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 // Embedder API (or SPI) for participating in browser logic, to be implemented | 122 // Embedder API (or SPI) for participating in browser logic, to be implemented |
123 // by the client of the content browser. See ChromeContentBrowserClient for the | 123 // by the client of the content browser. See ChromeContentBrowserClient for the |
124 // principal implementation. The methods are assumed to be called on the UI | 124 // principal implementation. The methods are assumed to be called on the UI |
125 // thread unless otherwise specified. Use this "escape hatch" sparingly, to | 125 // thread unless otherwise specified. Use this "escape hatch" sparingly, to |
126 // avoid the embedder interface ballooning and becoming very specific to Chrome. | 126 // avoid the embedder interface ballooning and becoming very specific to Chrome. |
127 // (Often, the call out to the client can happen in a different part of the code | 127 // (Often, the call out to the client can happen in a different part of the code |
128 // that either already has a hook out to the embedder, or calls out to one of | 128 // that either already has a hook out to the embedder, or calls out to one of |
129 // the observer interfaces.) | 129 // the observer interfaces.) |
130 class CONTENT_EXPORT ContentBrowserClient { | 130 class CONTENT_EXPORT ContentBrowserClient { |
131 public: | 131 public: |
132 enum AllowCertErrorOptionsMask { | |
Charlie Reis
2014/09/19 20:00:12
This should probably be in its own file in content
| |
133 OVERRIDABLE = 1 << 0, | |
Charlie Reis
2014/09/19 20:00:12
From the Content API guidelines:
"enum values shou
| |
134 STRICT_ENFORCEMENT = 1 << 1, | |
135 EXPIRED_PREVIOUS_DECISION = 1 << 2 | |
136 }; | |
137 | |
132 virtual ~ContentBrowserClient() {} | 138 virtual ~ContentBrowserClient() {} |
133 | 139 |
134 // Allows the embedder to set any number of custom BrowserMainParts | 140 // Allows the embedder to set any number of custom BrowserMainParts |
135 // implementations for the browser startup code. See comments in | 141 // implementations for the browser startup code. See comments in |
136 // browser_main_parts.h. | 142 // browser_main_parts.h. |
137 virtual BrowserMainParts* CreateBrowserMainParts( | 143 virtual BrowserMainParts* CreateBrowserMainParts( |
138 const MainFunctionParams& parameters); | 144 const MainFunctionParams& parameters); |
139 | 145 |
140 // If content creates the WebContentsView implementation, it will ask the | 146 // If content creates the WebContentsView implementation, it will ask the |
141 // embedder to return an (optional) delegate to customize it. The view will | 147 // embedder to return an (optional) delegate to customize it. The view will |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 BrowserContext* browser_context, | 370 BrowserContext* browser_context, |
365 const GURL& site, | 371 const GURL& site, |
366 bool can_be_default, | 372 bool can_be_default, |
367 std::string* partition_domain, | 373 std::string* partition_domain, |
368 std::string* partition_name, | 374 std::string* partition_name, |
369 bool* in_memory); | 375 bool* in_memory); |
370 | 376 |
371 // Create and return a new quota permission context. | 377 // Create and return a new quota permission context. |
372 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); | 378 virtual QuotaPermissionContext* CreateQuotaPermissionContext(); |
373 | 379 |
374 // Informs the embedder that a certificate error has occured. If | 380 // Informs the embedder that a certificate error has occured. |options_mask| |
375 // |overridable| is true and if |strict_enforcement| is false, the user | 381 // must be a bitwise OR of AllowCertErrorOptionsMask values. If |options_mask| |
376 // can ignore the error and continue. The embedder can call the callback | 382 // contains OVERRIDABLE and does not contain STRICT_ENFORCEMENT, the user can |
383 // ignore the error and continue. The embedder can call the callback | |
377 // asynchronously. If |result| is not set to | 384 // asynchronously. If |result| is not set to |
378 // CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE, the request will be cancelled | 385 // CERTIFICATE_REQUEST_RESULT_TYPE_CONTINUE, the request will be cancelled or |
379 // or denied immediately, and the callback won't be run. | 386 // denied immediately, and the callback won't be run. |
380 virtual void AllowCertificateError(int render_process_id, | 387 virtual void AllowCertificateError(int render_process_id, |
381 int render_frame_id, | 388 int render_frame_id, |
382 int cert_error, | 389 int cert_error, |
383 const net::SSLInfo& ssl_info, | 390 const net::SSLInfo& ssl_info, |
384 const GURL& request_url, | 391 const GURL& request_url, |
385 ResourceType resource_type, | 392 ResourceType resource_type, |
386 bool overridable, | 393 int options_mask, |
387 bool strict_enforcement, | |
388 bool expired_previous_decision, | |
389 const base::Callback<void(bool)>& callback, | 394 const base::Callback<void(bool)>& callback, |
390 CertificateRequestResultType* result) {} | 395 CertificateRequestResultType* result) {} |
391 | 396 |
392 // Selects a SSL client certificate and returns it to the |callback|. If no | 397 // Selects a SSL client certificate and returns it to the |callback|. If no |
393 // certificate was selected NULL is returned to the |callback|. | 398 // certificate was selected NULL is returned to the |callback|. |
394 virtual void SelectClientCertificate( | 399 virtual void SelectClientCertificate( |
395 int render_process_id, | 400 int render_process_id, |
396 int render_frame_id, | 401 int render_frame_id, |
397 const net::HttpNetworkSession* network_session, | 402 const net::HttpNetworkSession* network_session, |
398 net::SSLCertRequestInfo* cert_request_info, | 403 net::SSLCertRequestInfo* cert_request_info, |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
643 // camera. Note that this does not query the user. |type| must be | 648 // camera. Note that this does not query the user. |type| must be |
644 // MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE. | 649 // MEDIA_DEVICE_AUDIO_CAPTURE or MEDIA_DEVICE_VIDEO_CAPTURE. |
645 virtual bool CheckMediaAccessPermission(BrowserContext* browser_context, | 650 virtual bool CheckMediaAccessPermission(BrowserContext* browser_context, |
646 const GURL& security_origin, | 651 const GURL& security_origin, |
647 MediaStreamType type); | 652 MediaStreamType type); |
648 }; | 653 }; |
649 | 654 |
650 } // namespace content | 655 } // namespace content |
651 | 656 |
652 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ | 657 #endif // CONTENT_PUBLIC_BROWSER_CONTENT_BROWSER_CLIENT_H_ |
OLD | NEW |