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" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "android_webview/common/url_constants.h" | 27 #include "android_webview/common/url_constants.h" |
28 #include "android_webview/grit/aw_resources.h" | 28 #include "android_webview/grit/aw_resources.h" |
29 #include "base/android/locale_utils.h" | 29 #include "base/android/locale_utils.h" |
30 #include "base/base_paths_android.h" | 30 #include "base/base_paths_android.h" |
31 #include "base/command_line.h" | 31 #include "base/command_line.h" |
32 #include "base/files/scoped_file.h" | 32 #include "base/files/scoped_file.h" |
33 #include "base/json/json_reader.h" | 33 #include "base/json/json_reader.h" |
34 #include "base/memory/ptr_util.h" | 34 #include "base/memory/ptr_util.h" |
35 #include "base/path_service.h" | 35 #include "base/path_service.h" |
36 #include "components/cdm/browser/cdm_message_filter_android.h" | 36 #include "components/cdm/browser/cdm_message_filter_android.h" |
37 #include "components/crash/content/browser/crash_micro_dump_manager_android.h" | 37 #include "components/crash/content/browser/crash_dump_observer_android.h" |
38 #include "components/navigation_interception/intercept_navigation_delegate.h" | 38 #include "components/navigation_interception/intercept_navigation_delegate.h" |
39 #include "content/public/browser/browser_message_filter.h" | 39 #include "content/public/browser/browser_message_filter.h" |
40 #include "content/public/browser/browser_thread.h" | 40 #include "content/public/browser/browser_thread.h" |
41 #include "content/public/browser/child_process_security_policy.h" | 41 #include "content/public/browser/child_process_security_policy.h" |
42 #include "content/public/browser/client_certificate_delegate.h" | 42 #include "content/public/browser/client_certificate_delegate.h" |
43 #include "content/public/browser/navigation_handle.h" | 43 #include "content/public/browser/navigation_handle.h" |
44 #include "content/public/browser/navigation_throttle.h" | 44 #include "content/public/browser/navigation_throttle.h" |
45 #include "content/public/browser/render_frame_host.h" | 45 #include "content/public/browser/render_frame_host.h" |
46 #include "content/public/browser/render_process_host.h" | 46 #include "content/public/browser/render_process_host.h" |
47 #include "content/public/browser/render_view_host.h" | 47 #include "content/public/browser/render_view_host.h" |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
478 &(*regions)[kAndroidWebViewMainPakDescriptor]); | 478 &(*regions)[kAndroidWebViewMainPakDescriptor]); |
479 mappings->Share(kAndroidWebViewMainPakDescriptor, fd); | 479 mappings->Share(kAndroidWebViewMainPakDescriptor, fd); |
480 | 480 |
481 fd = ui::GetCommonResourcesPackFd( | 481 fd = ui::GetCommonResourcesPackFd( |
482 &(*regions)[kAndroidWebView100PercentPakDescriptor]); | 482 &(*regions)[kAndroidWebView100PercentPakDescriptor]); |
483 mappings->Share(kAndroidWebView100PercentPakDescriptor, fd); | 483 mappings->Share(kAndroidWebView100PercentPakDescriptor, fd); |
484 | 484 |
485 fd = ui::GetLocalePackFd(&(*regions)[kAndroidWebViewLocalePakDescriptor]); | 485 fd = ui::GetLocalePackFd(&(*regions)[kAndroidWebViewLocalePakDescriptor]); |
486 mappings->Share(kAndroidWebViewLocalePakDescriptor, fd); | 486 mappings->Share(kAndroidWebViewLocalePakDescriptor, fd); |
487 | 487 |
488 base::ScopedFD crash_signal_file = | 488 breakpad::CrashDumpObserver::GetInstance()->BrowserChildProcessStarted( |
489 breakpad::CrashMicroDumpManager::GetInstance()->CreateCrashInfoChannel( | 489 child_process_id, mappings); |
490 child_process_id); | |
491 if (crash_signal_file.is_valid()) { | |
492 mappings->Transfer(kAndroidWebViewCrashSignalDescriptor, | |
493 std::move(crash_signal_file)); | |
494 } | |
495 } | 490 } |
496 | 491 |
497 void AwContentBrowserClient::OverrideWebkitPrefs( | 492 void AwContentBrowserClient::OverrideWebkitPrefs( |
498 content::RenderViewHost* rvh, | 493 content::RenderViewHost* rvh, |
499 content::WebPreferences* web_prefs) { | 494 content::WebPreferences* web_prefs) { |
500 if (!preferences_populater_.get()) { | 495 if (!preferences_populater_.get()) { |
501 preferences_populater_ = | 496 preferences_populater_ = |
502 base::WrapUnique(native_factory_->CreateWebPreferencesPopulater()); | 497 base::WrapUnique(native_factory_->CreateWebPreferencesPopulater()); |
503 } | 498 } |
504 preferences_populater_->PopulateFor( | 499 preferences_populater_->PopulateFor( |
(...skipping 28 matching lines...) Expand all Loading... |
533 if (id == -1) | 528 if (id == -1) |
534 return nullptr; | 529 return nullptr; |
535 | 530 |
536 base::StringPiece manifest_contents = | 531 base::StringPiece manifest_contents = |
537 ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( | 532 ui::ResourceBundle::GetSharedInstance().GetRawDataResourceForScale( |
538 id, ui::ScaleFactor::SCALE_FACTOR_NONE); | 533 id, ui::ScaleFactor::SCALE_FACTOR_NONE); |
539 return base::JSONReader::Read(manifest_contents); | 534 return base::JSONReader::Read(manifest_contents); |
540 } | 535 } |
541 | 536 |
542 } // namespace android_webview | 537 } // namespace android_webview |
OLD | NEW |