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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #include "chrome/browser/tab_contents/tab_util.h" | 65 #include "chrome/browser/tab_contents/tab_util.h" |
66 #include "chrome/browser/ui/media_stream_infobar_delegate.h" | 66 #include "chrome/browser/ui/media_stream_infobar_delegate.h" |
67 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 67 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
68 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" | 68 #include "chrome/browser/ui/webui/chrome_web_ui_controller_factory.h" |
69 #include "chrome/browser/user_style_sheet_watcher.h" | 69 #include "chrome/browser/user_style_sheet_watcher.h" |
70 #include "chrome/browser/user_style_sheet_watcher_factory.h" | 70 #include "chrome/browser/user_style_sheet_watcher_factory.h" |
71 #include "chrome/common/child_process_logging.h" | 71 #include "chrome/common/child_process_logging.h" |
72 #include "chrome/common/chrome_constants.h" | 72 #include "chrome/common/chrome_constants.h" |
73 #include "chrome/common/chrome_switches.h" | 73 #include "chrome/common/chrome_switches.h" |
74 #include "chrome/common/extensions/extension.h" | 74 #include "chrome/common/extensions/extension.h" |
| 75 #include "chrome/common/extensions/extension_process_policy.h" |
75 #include "chrome/common/extensions/extension_set.h" | 76 #include "chrome/common/extensions/extension_set.h" |
76 #include "chrome/common/logging_chrome.h" | 77 #include "chrome/common/logging_chrome.h" |
77 #include "chrome/common/pref_names.h" | 78 #include "chrome/common/pref_names.h" |
78 #include "chrome/common/render_messages.h" | 79 #include "chrome/common/render_messages.h" |
79 #include "chrome/common/url_constants.h" | 80 #include "chrome/common/url_constants.h" |
80 #include "content/public/browser/browser_child_process_host.h" | 81 #include "content/public/browser/browser_child_process_host.h" |
81 #include "content/public/browser/browser_main_parts.h" | 82 #include "content/public/browser/browser_main_parts.h" |
82 #include "content/public/browser/browser_url_handler.h" | 83 #include "content/public/browser/browser_url_handler.h" |
83 #include "content/public/browser/child_process_security_policy.h" | 84 #include "content/public/browser/child_process_security_policy.h" |
84 #include "content/public/browser/render_process_host.h" | 85 #include "content/public/browser/render_process_host.h" |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 // same extension. | 676 // same extension. |
676 if (current_url.SchemeIs(chrome::kExtensionScheme) || | 677 if (current_url.SchemeIs(chrome::kExtensionScheme) || |
677 new_url.SchemeIs(chrome::kExtensionScheme)) { | 678 new_url.SchemeIs(chrome::kExtensionScheme)) { |
678 if (current_url.GetOrigin() != new_url.GetOrigin()) | 679 if (current_url.GetOrigin() != new_url.GetOrigin()) |
679 return true; | 680 return true; |
680 } | 681 } |
681 | 682 |
682 return false; | 683 return false; |
683 } | 684 } |
684 | 685 |
| 686 bool ChromeContentBrowserClient::ShouldSwapProcessesForRedirect( |
| 687 content::ResourceContext* resource_context, const GURL& current_url, |
| 688 const GURL& new_url) { |
| 689 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 690 return extensions::CrossesExtensionProcessBoundary( |
| 691 io_data->GetExtensionInfoMap()->extensions(), |
| 692 ExtensionURLInfo(current_url), ExtensionURLInfo(new_url)); |
| 693 } |
| 694 |
685 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( | 695 std::string ChromeContentBrowserClient::GetCanonicalEncodingNameByAliasName( |
686 const std::string& alias_name) { | 696 const std::string& alias_name) { |
687 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); | 697 return CharacterEncoding::GetCanonicalEncodingNameByAliasName(alias_name); |
688 } | 698 } |
689 | 699 |
690 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( | 700 void ChromeContentBrowserClient::AppendExtraCommandLineSwitches( |
691 CommandLine* command_line, int child_process_id) { | 701 CommandLine* command_line, int child_process_id) { |
692 #if defined(USE_LINUX_BREAKPAD) | 702 #if defined(USE_LINUX_BREAKPAD) |
693 if (IsCrashReporterEnabled()) { | 703 if (IsCrashReporterEnabled()) { |
694 command_line->AppendSwitchASCII(switches::kEnableCrashReporter, | 704 command_line->AppendSwitchASCII(switches::kEnableCrashReporter, |
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 #if defined(USE_NSS) | 1628 #if defined(USE_NSS) |
1619 crypto::CryptoModuleBlockingPasswordDelegate* | 1629 crypto::CryptoModuleBlockingPasswordDelegate* |
1620 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 1630 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
1621 const GURL& url) { | 1631 const GURL& url) { |
1622 return browser::NewCryptoModuleBlockingDialogDelegate( | 1632 return browser::NewCryptoModuleBlockingDialogDelegate( |
1623 browser::kCryptoModulePasswordKeygen, url.host()); | 1633 browser::kCryptoModulePasswordKeygen, url.host()); |
1624 } | 1634 } |
1625 #endif | 1635 #endif |
1626 | 1636 |
1627 } // namespace chrome | 1637 } // namespace chrome |
OLD | NEW |