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 1833 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1940 | 1942 |
1941 return false; | 1943 return false; |
1942 } | 1944 } |
1943 | 1945 |
1944 FilePath ChromeContentBrowserClient::GetHyphenDictionaryDirectory() { | 1946 FilePath ChromeContentBrowserClient::GetHyphenDictionaryDirectory() { |
1945 FilePath directory; | 1947 FilePath directory; |
1946 PathService::Get(chrome::DIR_APP_DICTIONARIES, &directory); | 1948 PathService::Get(chrome::DIR_APP_DICTIONARIES, &directory); |
1947 return directory.Append(FILE_PATH_LITERAL("Hyphen")); | 1949 return directory.Append(FILE_PATH_LITERAL("Hyphen")); |
1948 } | 1950 } |
1949 | 1951 |
| 1952 void ChromeContentBrowserClient::BeforeWriteToClipboard( |
| 1953 const content::ClipboardWriteCallbackParams& params) { |
| 1954 DCHECK(params.browser_context != NULL); |
| 1955 Profile* profile = Profile::FromBrowserContext(params.browser_context); |
| 1956 DCHECK(profile != NULL); |
| 1957 AddIncognitoMarkerForOffTheRecordProfile(params.objects, profile); |
| 1958 } |
| 1959 |
1950 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 1960 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
1951 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 1961 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
1952 const CommandLine& command_line, | 1962 const CommandLine& command_line, |
1953 int child_process_id, | 1963 int child_process_id, |
1954 std::vector<FileDescriptorInfo>* mappings) { | 1964 std::vector<FileDescriptorInfo>* mappings) { |
1955 #if defined(OS_ANDROID) | 1965 #if defined(OS_ANDROID) |
1956 FilePath data_path; | 1966 FilePath data_path; |
1957 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); | 1967 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); |
1958 DCHECK(!data_path.empty()); | 1968 DCHECK(!data_path.empty()); |
1959 | 1969 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2045 io_thread_application_locale_ = locale; | 2055 io_thread_application_locale_ = locale; |
2046 } | 2056 } |
2047 | 2057 |
2048 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 2058 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
2049 const std::string& locale) { | 2059 const std::string& locale) { |
2050 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 2060 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
2051 io_thread_application_locale_ = locale; | 2061 io_thread_application_locale_ = locale; |
2052 } | 2062 } |
2053 | 2063 |
2054 } // namespace chrome | 2064 } // namespace chrome |
OLD | NEW |