Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: android_webview/browser/aw_content_browser_client.cc

Issue 859213006: Cancel client auth requests when not promptable. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@client-auth-cancel-1
Patch Set: extension test Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include "android_webview/browser/aw_content_browser_client.h" 5 #include "android_webview/browser/aw_content_browser_client.h"
6 6
7 #include "android_webview/browser/aw_browser_context.h" 7 #include "android_webview/browser/aw_browser_context.h"
8 #include "android_webview/browser/aw_browser_main_parts.h" 8 #include "android_webview/browser/aw_browser_main_parts.h"
9 #include "android_webview/browser/aw_browser_permission_request_delegate.h" 9 #include "android_webview/browser/aw_browser_permission_request_delegate.h"
10 #include "android_webview/browser/aw_contents_client_bridge_base.h" 10 #include "android_webview/browser/aw_contents_client_bridge_base.h"
(...skipping 10 matching lines...) Expand all
21 #include "android_webview/common/render_view_messages.h" 21 #include "android_webview/common/render_view_messages.h"
22 #include "android_webview/common/url_constants.h" 22 #include "android_webview/common/url_constants.h"
23 #include "base/android/locale_utils.h" 23 #include "base/android/locale_utils.h"
24 #include "base/base_paths_android.h" 24 #include "base/base_paths_android.h"
25 #include "base/path_service.h" 25 #include "base/path_service.h"
26 #include "components/cdm/browser/cdm_message_filter_android.h" 26 #include "components/cdm/browser/cdm_message_filter_android.h"
27 #include "content/public/browser/access_token_store.h" 27 #include "content/public/browser/access_token_store.h"
28 #include "content/public/browser/browser_message_filter.h" 28 #include "content/public/browser/browser_message_filter.h"
29 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
30 #include "content/public/browser/child_process_security_policy.h" 30 #include "content/public/browser/child_process_security_policy.h"
31 #include "content/public/browser/client_certificate_delegate.h"
31 #include "content/public/browser/permission_type.h" 32 #include "content/public/browser/permission_type.h"
32 #include "content/public/browser/render_process_host.h" 33 #include "content/public/browser/render_process_host.h"
33 #include "content/public/browser/render_view_host.h" 34 #include "content/public/browser/render_view_host.h"
34 #include "content/public/browser/web_contents.h" 35 #include "content/public/browser/web_contents.h"
35 #include "content/public/common/url_constants.h" 36 #include "content/public/common/url_constants.h"
36 #include "content/public/common/web_preferences.h" 37 #include "content/public/common/web_preferences.h"
37 #include "net/android/network_library.h" 38 #include "net/android/network_library.h"
38 #include "net/ssl/ssl_cert_request_info.h" 39 #include "net/ssl/ssl_cert_request_info.h"
39 #include "net/ssl/ssl_info.h" 40 #include "net/ssl/ssl_info.h"
40 #include "ui/base/resource/resource_bundle.h" 41 #include "ui/base/resource/resource_bundle.h"
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 client->AllowCertificateError(cert_error, 355 client->AllowCertificateError(cert_error,
355 ssl_info.cert.get(), 356 ssl_info.cert.get(),
356 request_url, 357 request_url,
357 callback, 358 callback,
358 &cancel_request); 359 &cancel_request);
359 if (cancel_request) 360 if (cancel_request)
360 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY; 361 *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY;
361 } 362 }
362 363
363 void AwContentBrowserClient::SelectClientCertificate( 364 void AwContentBrowserClient::SelectClientCertificate(
364 int render_process_id, 365 content::WebContents* web_contents,
365 int render_frame_id, 366 net::SSLCertRequestInfo* cert_request_info,
366 net::SSLCertRequestInfo* cert_request_info, 367 scoped_ptr<content::ClientCertificateDelegate> delegate) {
367 const base::Callback<void(net::X509Certificate*)>& callback) {
368 AwContentsClientBridgeBase* client = 368 AwContentsClientBridgeBase* client =
369 AwContentsClientBridgeBase::FromID(render_process_id, render_frame_id); 369 AwContentsClientBridgeBase::FromWebContents(web_contents);
370 if (client) { 370 if (client) {
371 client->SelectClientCertificate(cert_request_info, callback); 371 client->SelectClientCertificate(cert_request_info, delegate.Pass());
372 } else { 372 } else {
373 callback.Run(NULL); 373 delegate->ContinueWithCertificate(nullptr);
374 } 374 }
375 } 375 }
376 376
377 void AwContentBrowserClient::RequestPermission( 377 void AwContentBrowserClient::RequestPermission(
378 content::PermissionType permission, 378 content::PermissionType permission,
379 content::WebContents* web_contents, 379 content::WebContents* web_contents,
380 int bridge_id, 380 int bridge_id,
381 const GURL& requesting_frame, 381 const GURL& requesting_frame,
382 bool user_gesture, 382 bool user_gesture,
383 const base::Callback<void(bool)>& result_callback) { 383 const base::Callback<void(bool)>& result_callback) {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); 550 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents);
551 } 551 }
552 #endif 552 #endif
553 553
554 content::DevToolsManagerDelegate* 554 content::DevToolsManagerDelegate*
555 AwContentBrowserClient::GetDevToolsManagerDelegate() { 555 AwContentBrowserClient::GetDevToolsManagerDelegate() {
556 return new AwDevToolsManagerDelegate(); 556 return new AwDevToolsManagerDelegate();
557 } 557 }
558 558
559 } // namespace android_webview 559 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698