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