| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/path_service.h" | 13 #include "base/path_service.h" |
| 14 #include "base/string_tokenizer.h" | 14 #include "base/string_tokenizer.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/app/breakpad_mac.h" | 16 #include "chrome/app/breakpad_mac.h" |
| 17 #include "chrome/browser/browser_about_handler.h" | 17 #include "chrome/browser/browser_about_handler.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" | 19 #include "chrome/browser/browsing_data/browsing_data_helper.h" |
| 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" | 20 #include "chrome/browser/browsing_data/browsing_data_remover.h" |
| 21 #include "chrome/browser/character_encoding.h" | 21 #include "chrome/browser/character_encoding.h" |
| 22 #include "chrome/browser/chrome_benchmarking_message_filter.h" | 22 #include "chrome/browser/chrome_benchmarking_message_filter.h" |
| 23 #include "chrome/browser/chrome_quota_permission_context.h" | 23 #include "chrome/browser/chrome_quota_permission_context.h" |
| 24 #include "chrome/browser/clipboard/incognito_marker.h" |
| 24 #include "chrome/browser/content_settings/content_settings_utils.h" | 25 #include "chrome/browser/content_settings/content_settings_utils.h" |
| 25 #include "chrome/browser/content_settings/cookie_settings.h" | 26 #include "chrome/browser/content_settings/cookie_settings.h" |
| 26 #include "chrome/browser/content_settings/host_content_settings_map.h" | 27 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 27 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 28 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 28 #include "chrome/browser/defaults.h" | 29 #include "chrome/browser/defaults.h" |
| 29 #include "chrome/browser/download/download_util.h" | 30 #include "chrome/browser/download/download_util.h" |
| 30 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 31 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| 31 #include "chrome/browser/extensions/extension_host.h" | 32 #include "chrome/browser/extensions/extension_host.h" |
| 32 #include "chrome/browser/extensions/extension_info_map.h" | 33 #include "chrome/browser/extensions/extension_info_map.h" |
| 33 #include "chrome/browser/extensions/extension_process_manager.h" | 34 #include "chrome/browser/extensions/extension_process_manager.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 #include "chrome/common/logging_chrome.h" | 88 #include "chrome/common/logging_chrome.h" |
| 88 #include "chrome/common/pref_names.h" | 89 #include "chrome/common/pref_names.h" |
| 89 #include "chrome/common/render_messages.h" | 90 #include "chrome/common/render_messages.h" |
| 90 #include "chrome/common/url_constants.h" | 91 #include "chrome/common/url_constants.h" |
| 91 #include "content/public/browser/browser_child_process_host.h" | 92 #include "content/public/browser/browser_child_process_host.h" |
| 92 #include "content/public/browser/browser_main_parts.h" | 93 #include "content/public/browser/browser_main_parts.h" |
| 93 #include "content/public/browser/browser_ppapi_host.h" | 94 #include "content/public/browser/browser_ppapi_host.h" |
| 94 #include "content/public/browser/browser_url_handler.h" | 95 #include "content/public/browser/browser_url_handler.h" |
| 95 #include "content/public/browser/child_process_data.h" | 96 #include "content/public/browser/child_process_data.h" |
| 96 #include "content/public/browser/child_process_security_policy.h" | 97 #include "content/public/browser/child_process_security_policy.h" |
| 98 #include "content/public/browser/clipboard_write_callback_params.h" |
| 97 #include "content/public/browser/compositor_util.h" | 99 #include "content/public/browser/compositor_util.h" |
| 98 #include "content/public/browser/render_process_host.h" | 100 #include "content/public/browser/render_process_host.h" |
| 99 #include "content/public/browser/render_view_host.h" | 101 #include "content/public/browser/render_view_host.h" |
| 100 #include "content/public/browser/resource_context.h" | 102 #include "content/public/browser/resource_context.h" |
| 101 #include "content/public/browser/site_instance.h" | 103 #include "content/public/browser/site_instance.h" |
| 102 #include "content/public/browser/web_contents.h" | 104 #include "content/public/browser/web_contents.h" |
| 103 #include "content/public/browser/web_contents_view.h" | 105 #include "content/public/browser/web_contents_view.h" |
| 104 #include "content/public/common/child_process_host.h" | 106 #include "content/public/common/child_process_host.h" |
| 105 #include "content/public/common/content_descriptors.h" | 107 #include "content/public/common/content_descriptors.h" |
| 106 #include "extensions/common/constants.h" | 108 #include "extensions/common/constants.h" |
| (...skipping 1834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1941 | 1943 |
| 1942 return false; | 1944 return false; |
| 1943 } | 1945 } |
| 1944 | 1946 |
| 1945 FilePath ChromeContentBrowserClient::GetHyphenDictionaryDirectory() { | 1947 FilePath ChromeContentBrowserClient::GetHyphenDictionaryDirectory() { |
| 1946 FilePath directory; | 1948 FilePath directory; |
| 1947 PathService::Get(chrome::DIR_APP_DICTIONARIES, &directory); | 1949 PathService::Get(chrome::DIR_APP_DICTIONARIES, &directory); |
| 1948 return directory.Append(FILE_PATH_LITERAL("Hyphen")); | 1950 return directory.Append(FILE_PATH_LITERAL("Hyphen")); |
| 1949 } | 1951 } |
| 1950 | 1952 |
| 1953 void ChromeContentBrowserClient::BeforeWriteToClipboard( |
| 1954 const content::ClipboardWriteCallbackParams& params) { |
| 1955 DCHECK(params.browser_context != NULL); |
| 1956 Profile* profile = Profile::FromBrowserContext(params.browser_context); |
| 1957 DCHECK(profile != NULL); |
| 1958 AddIncognitoMarkerForOffTheRecordProfile(params.objects, profile); |
| 1959 } |
| 1960 |
| 1951 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 1961 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 1952 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 1962 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| 1953 const CommandLine& command_line, | 1963 const CommandLine& command_line, |
| 1954 int child_process_id, | 1964 int child_process_id, |
| 1955 std::vector<FileDescriptorInfo>* mappings) { | 1965 std::vector<FileDescriptorInfo>* mappings) { |
| 1956 #if defined(OS_ANDROID) | 1966 #if defined(OS_ANDROID) |
| 1957 FilePath data_path; | 1967 FilePath data_path; |
| 1958 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); | 1968 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); |
| 1959 DCHECK(!data_path.empty()); | 1969 DCHECK(!data_path.empty()); |
| 1960 | 1970 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2046 io_thread_application_locale_ = locale; | 2056 io_thread_application_locale_ = locale; |
| 2047 } | 2057 } |
| 2048 | 2058 |
| 2049 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 2059 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
| 2050 const std::string& locale) { | 2060 const std::string& locale) { |
| 2051 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2061 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 2052 io_thread_application_locale_ = locale; | 2062 io_thread_application_locale_ = locale; |
| 2053 } | 2063 } |
| 2054 | 2064 |
| 2055 } // namespace chrome | 2065 } // namespace chrome |
| OLD | NEW |