| 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 #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_main_parts.h" | 7 #include "android_webview/browser/aw_browser_main_parts.h" |
| 8 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
| 8 #include "android_webview/browser/aw_cookie_access_policy.h" | 9 #include "android_webview/browser/aw_cookie_access_policy.h" |
| 9 #include "android_webview/browser/aw_quota_permission_context.h" | 10 #include "android_webview/browser/aw_quota_permission_context.h" |
| 10 #include "android_webview/browser/net_disk_cache_remover.h" | 11 #include "android_webview/browser/net_disk_cache_remover.h" |
| 11 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" | 12 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" |
| 12 #include "android_webview/common/url_constants.h" | 13 #include "android_webview/common/url_constants.h" |
| 13 #include "base/android/locale_utils.h" | 14 #include "base/android/locale_utils.h" |
| 14 #include "base/base_paths_android.h" | 15 #include "base/base_paths_android.h" |
| 15 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 16 #include "content/public/browser/access_token_store.h" | 17 #include "content/public/browser/access_token_store.h" |
| 17 #include "content/public/browser/child_process_security_policy.h" | 18 #include "content/public/browser/child_process_security_policy.h" |
| 18 #include "content/public/browser/render_process_host.h" | 19 #include "content/public/browser/render_process_host.h" |
| 19 #include "content/public/browser/render_view_host.h" | 20 #include "content/public/browser/render_view_host.h" |
| 20 #include "content/public/common/url_constants.h" | 21 #include "content/public/common/url_constants.h" |
| 21 #include "grit/ui_resources.h" | 22 #include "grit/ui_resources.h" |
| 22 #include "net/android/network_library.h" | 23 #include "net/android/network_library.h" |
| 24 #include "net/base/ssl_info.h" |
| 23 #include "ui/base/resource/resource_bundle.h" | 25 #include "ui/base/resource/resource_bundle.h" |
| 24 | 26 |
| 25 namespace { | 27 namespace { |
| 26 | 28 |
| 27 class AwAccessTokenStore : public content::AccessTokenStore { | 29 class AwAccessTokenStore : public content::AccessTokenStore { |
| 28 public: | 30 public: |
| 29 AwAccessTokenStore() { } | 31 AwAccessTokenStore() { } |
| 30 | 32 |
| 31 // content::AccessTokenStore implementation | 33 // content::AccessTokenStore implementation |
| 32 virtual void LoadAccessTokens( | 34 virtual void LoadAccessTokens( |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 void AwContentBrowserClient::AllowCertificateError( | 260 void AwContentBrowserClient::AllowCertificateError( |
| 259 int render_process_id, | 261 int render_process_id, |
| 260 int render_view_id, | 262 int render_view_id, |
| 261 int cert_error, | 263 int cert_error, |
| 262 const net::SSLInfo& ssl_info, | 264 const net::SSLInfo& ssl_info, |
| 263 const GURL& request_url, | 265 const GURL& request_url, |
| 264 bool overridable, | 266 bool overridable, |
| 265 bool strict_enforcement, | 267 bool strict_enforcement, |
| 266 const base::Callback<void(bool)>& callback, | 268 const base::Callback<void(bool)>& callback, |
| 267 bool* cancel_request) { | 269 bool* cancel_request) { |
| 268 // TODO(boliu): Implement this to power WebViewClient.onReceivedSslError. | 270 |
| 269 NOTIMPLEMENTED(); | 271 AwContentsClientBridgeBase* client = |
| 270 *cancel_request = true; | 272 AwContentsClientBridgeBase::FromID(render_process_id, render_view_id); |
| 273 if (client) { |
| 274 client->AllowCertificateError(cert_error, ssl_info.cert, request_url, |
| 275 callback, cancel_request); |
| 276 } else { |
| 277 *cancel_request = true; |
| 278 } |
| 271 } | 279 } |
| 272 | 280 |
| 273 WebKit::WebNotificationPresenter::Permission | 281 WebKit::WebNotificationPresenter::Permission |
| 274 AwContentBrowserClient::CheckDesktopNotificationPermission( | 282 AwContentBrowserClient::CheckDesktopNotificationPermission( |
| 275 const GURL& source_url, | 283 const GURL& source_url, |
| 276 content::ResourceContext* context, | 284 content::ResourceContext* context, |
| 277 int render_process_id) { | 285 int render_process_id) { |
| 278 // Android WebView does not support notifications, so return Denied here. | 286 // Android WebView does not support notifications, so return Denied here. |
| 279 return WebKit::WebNotificationPresenter::PermissionDenied; | 287 return WebKit::WebNotificationPresenter::PermissionDenied; |
| 280 } | 288 } |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 | 393 |
| 386 bool AwContentBrowserClient::AllowPepperSocketAPI( | 394 bool AwContentBrowserClient::AllowPepperSocketAPI( |
| 387 content::BrowserContext* browser_context, | 395 content::BrowserContext* browser_context, |
| 388 const GURL& url, | 396 const GURL& url, |
| 389 const content::SocketPermissionRequest& params) { | 397 const content::SocketPermissionRequest& params) { |
| 390 NOTREACHED() << "Android WebView does not support plugins"; | 398 NOTREACHED() << "Android WebView does not support plugins"; |
| 391 return false; | 399 return false; |
| 392 } | 400 } |
| 393 | 401 |
| 394 } // namespace android_webview | 402 } // namespace android_webview |
| OLD | NEW |