| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
| 10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
| 11 #include "android_webview/browser/aw_contents_client_bridge_base.h" | 11 #include "android_webview/browser/aw_contents_client_bridge_base.h" |
| 12 #include "android_webview/browser/aw_contents_io_thread_client.h" | 12 #include "android_webview/browser/aw_contents_io_thread_client.h" |
| 13 #include "android_webview/browser/aw_cookie_access_policy.h" | 13 #include "android_webview/browser/aw_cookie_access_policy.h" |
| 14 #include "android_webview/browser/aw_locale_manager.h" | 14 #include "android_webview/browser/aw_locale_manager.h" |
| 15 #include "android_webview/browser/aw_printing_message_filter.h" | 15 #include "android_webview/browser/aw_printing_message_filter.h" |
| 16 #include "android_webview/browser/aw_quota_permission_context.h" | 16 #include "android_webview/browser/aw_quota_permission_context.h" |
| 17 #include "android_webview/browser/aw_web_preferences_populater.h" | 17 #include "android_webview/browser/aw_web_preferences_populater.h" |
| 18 #include "android_webview/browser/jni_dependency_factory.h" | 18 #include "android_webview/browser/jni_dependency_factory.h" |
| 19 #include "android_webview/browser/net/aw_url_request_context_getter.h" | 19 #include "android_webview/browser/net/aw_url_request_context_getter.h" |
| 20 #include "android_webview/browser/net_disk_cache_remover.h" | 20 #include "android_webview/browser/net_disk_cache_remover.h" |
| 21 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" | 21 #include "android_webview/browser/renderer_host/aw_resource_dispatcher_host_dele
gate.h" |
| 22 #include "android_webview/common/aw_descriptors.h" | 22 #include "android_webview/common/aw_descriptors.h" |
| 23 #include "android_webview/common/aw_switches.h" | 23 #include "android_webview/common/aw_switches.h" |
| 24 #include "android_webview/common/render_view_messages.h" | 24 #include "android_webview/common/render_view_messages.h" |
| 25 #include "android_webview/common/url_constants.h" | 25 #include "android_webview/common/url_constants.h" |
| 26 #include "base/android/locale_utils.h" | 26 #include "base/android/locale_utils.h" |
| 27 #include "base/base_paths_android.h" | 27 #include "base/base_paths_android.h" |
| 28 #include "base/command_line.h" | 28 #include "base/command_line.h" |
| 29 #include "base/files/scoped_file.h" |
| 29 #include "base/path_service.h" | 30 #include "base/path_service.h" |
| 30 #include "components/cdm/browser/cdm_message_filter_android.h" | 31 #include "components/cdm/browser/cdm_message_filter_android.h" |
| 32 #include "components/crash/content/browser/crash_micro_dump_manager_android.h" |
| 31 #include "components/navigation_interception/intercept_navigation_delegate.h" | 33 #include "components/navigation_interception/intercept_navigation_delegate.h" |
| 32 #include "content/public/browser/access_token_store.h" | 34 #include "content/public/browser/access_token_store.h" |
| 33 #include "content/public/browser/browser_message_filter.h" | 35 #include "content/public/browser/browser_message_filter.h" |
| 34 #include "content/public/browser/child_process_security_policy.h" | 36 #include "content/public/browser/child_process_security_policy.h" |
| 35 #include "content/public/browser/client_certificate_delegate.h" | 37 #include "content/public/browser/client_certificate_delegate.h" |
| 36 #include "content/public/browser/navigation_handle.h" | 38 #include "content/public/browser/navigation_handle.h" |
| 37 #include "content/public/browser/navigation_throttle.h" | 39 #include "content/public/browser/navigation_throttle.h" |
| 38 #include "content/public/browser/render_frame_host.h" | 40 #include "content/public/browser/render_frame_host.h" |
| 39 #include "content/public/browser/render_process_host.h" | 41 #include "content/public/browser/render_process_host.h" |
| 40 #include "content/public/browser/render_view_host.h" | 42 #include "content/public/browser/render_view_host.h" |
| (...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 | 428 |
| 427 net::NetLog* AwContentBrowserClient::GetNetLog() { | 429 net::NetLog* AwContentBrowserClient::GetNetLog() { |
| 428 return browser_context_->GetAwURLRequestContext()->GetNetLog(); | 430 return browser_context_->GetAwURLRequestContext()->GetNetLog(); |
| 429 } | 431 } |
| 430 | 432 |
| 431 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { | 433 content::AccessTokenStore* AwContentBrowserClient::CreateAccessTokenStore() { |
| 432 return new AwAccessTokenStore(); | 434 return new AwAccessTokenStore(); |
| 433 } | 435 } |
| 434 | 436 |
| 435 bool AwContentBrowserClient::IsFastShutdownPossible() { | 437 bool AwContentBrowserClient::IsFastShutdownPossible() { |
| 436 NOTREACHED() << "Android WebView is single process, so IsFastShutdownPossible" | 438 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 437 << " should never be called"; | 439 switches::kSingleProcess)) { |
| 438 return false; | 440 NOTREACHED() |
| 441 << "Android WebView is single process, so IsFastShutdownPossible" |
| 442 << " should never be called"; |
| 443 return false; |
| 444 } else { |
| 445 return true; |
| 446 } |
| 439 } | 447 } |
| 440 | 448 |
| 441 void AwContentBrowserClient::ClearCache(content::RenderFrameHost* rfh) { | 449 void AwContentBrowserClient::ClearCache(content::RenderFrameHost* rfh) { |
| 442 RemoveHttpDiskCache(rfh->GetProcess()->GetBrowserContext(), | 450 RemoveHttpDiskCache(rfh->GetProcess()->GetBrowserContext(), |
| 443 rfh->GetProcess()->GetID()); | 451 rfh->GetProcess()->GetID()); |
| 444 } | 452 } |
| 445 | 453 |
| 446 void AwContentBrowserClient::ClearCookies(content::RenderFrameHost* rfh) { | 454 void AwContentBrowserClient::ClearCookies(content::RenderFrameHost* rfh) { |
| 447 // TODO(boliu): Implement. | 455 // TODO(boliu): Implement. |
| 448 NOTIMPLEMENTED(); | 456 NOTIMPLEMENTED(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 const base::CommandLine& command_line, | 488 const base::CommandLine& command_line, |
| 481 int child_process_id, | 489 int child_process_id, |
| 482 content::FileDescriptorInfo* mappings, | 490 content::FileDescriptorInfo* mappings, |
| 483 std::map<int, base::MemoryMappedFile::Region>* regions) { | 491 std::map<int, base::MemoryMappedFile::Region>* regions) { |
| 484 int fd = ui::GetMainAndroidPackFd( | 492 int fd = ui::GetMainAndroidPackFd( |
| 485 &(*regions)[kAndroidWebViewMainPakDescriptor]); | 493 &(*regions)[kAndroidWebViewMainPakDescriptor]); |
| 486 mappings->Share(kAndroidWebViewMainPakDescriptor, fd); | 494 mappings->Share(kAndroidWebViewMainPakDescriptor, fd); |
| 487 | 495 |
| 488 fd = ui::GetLocalePackFd(&(*regions)[kAndroidWebViewLocalePakDescriptor]); | 496 fd = ui::GetLocalePackFd(&(*regions)[kAndroidWebViewLocalePakDescriptor]); |
| 489 mappings->Share(kAndroidWebViewLocalePakDescriptor, fd); | 497 mappings->Share(kAndroidWebViewLocalePakDescriptor, fd); |
| 498 |
| 499 base::ScopedFD crash_signal_file = |
| 500 breakpad::CrashMicroDumpManager::GetInstance()->CreateCrashInfoChannel( |
| 501 child_process_id); |
| 502 if (crash_signal_file.is_valid()) { |
| 503 mappings->Transfer(kAndroidWebViewCrashSignalDescriptor, |
| 504 std::move(crash_signal_file)); |
| 505 } |
| 490 } | 506 } |
| 491 | 507 |
| 492 void AwContentBrowserClient::OverrideWebkitPrefs( | 508 void AwContentBrowserClient::OverrideWebkitPrefs( |
| 493 content::RenderViewHost* rvh, | 509 content::RenderViewHost* rvh, |
| 494 content::WebPreferences* web_prefs) { | 510 content::WebPreferences* web_prefs) { |
| 495 if (!preferences_populater_.get()) { | 511 if (!preferences_populater_.get()) { |
| 496 preferences_populater_ = make_scoped_ptr(native_factory_-> | 512 preferences_populater_ = make_scoped_ptr(native_factory_-> |
| 497 CreateWebPreferencesPopulater()); | 513 CreateWebPreferencesPopulater()); |
| 498 } | 514 } |
| 499 preferences_populater_->PopulateFor( | 515 preferences_populater_->PopulateFor( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 517 | 533 |
| 518 #if defined(VIDEO_HOLE) | 534 #if defined(VIDEO_HOLE) |
| 519 content::ExternalVideoSurfaceContainer* | 535 content::ExternalVideoSurfaceContainer* |
| 520 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( | 536 AwContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( |
| 521 content::WebContents* web_contents) { | 537 content::WebContents* web_contents) { |
| 522 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); | 538 return native_factory_->CreateExternalVideoSurfaceContainer(web_contents); |
| 523 } | 539 } |
| 524 #endif | 540 #endif |
| 525 | 541 |
| 526 } // namespace android_webview | 542 } // namespace android_webview |
| OLD | NEW |