OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "chrome/app/breakpad_mac.h" | 8 #include "chrome/app/breakpad_mac.h" |
9 #include "chrome/browser/browser_about_handler.h" | 9 #include "chrome/browser/browser_about_handler.h" |
10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
11 #include "chrome/browser/browsing_data_remover.h" | 11 #include "chrome/browser/browsing_data_remover.h" |
12 #include "chrome/browser/character_encoding.h" | 12 #include "chrome/browser/character_encoding.h" |
13 #include "chrome/browser/chrome_benchmarking_message_filter.h" | |
13 #include "chrome/browser/chrome_plugin_message_filter.h" | 14 #include "chrome/browser/chrome_plugin_message_filter.h" |
14 #include "chrome/browser/chrome_quota_permission_context.h" | 15 #include "chrome/browser/chrome_quota_permission_context.h" |
15 #include "chrome/browser/chrome_worker_message_filter.h" | 16 #include "chrome/browser/chrome_worker_message_filter.h" |
16 #include "chrome/browser/content_settings/host_content_settings_map.h" | 17 #include "chrome/browser/content_settings/host_content_settings_map.h" |
17 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 18 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
18 #include "chrome/browser/download/download_util.h" | 19 #include "chrome/browser/download/download_util.h" |
19 #include "chrome/browser/extensions/extension_info_map.h" | 20 #include "chrome/browser/extensions/extension_info_map.h" |
20 #include "chrome/browser/extensions/extension_message_handler.h" | 21 #include "chrome/browser/extensions/extension_message_handler.h" |
21 #include "chrome/browser/extensions/extension_service.h" | 22 #include "chrome/browser/extensions/extension_service.h" |
22 #include "chrome/browser/extensions/extension_web_ui.h" | 23 #include "chrome/browser/extensions/extension_web_ui.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 void ChromeContentBrowserClient::BrowserRenderProcessHostCreated( | 162 void ChromeContentBrowserClient::BrowserRenderProcessHostCreated( |
162 BrowserRenderProcessHost* host) { | 163 BrowserRenderProcessHost* host) { |
163 int id = host->id(); | 164 int id = host->id(); |
164 Profile* profile = Profile::FromBrowserContext(host->browser_context()); | 165 Profile* profile = Profile::FromBrowserContext(host->browser_context()); |
165 host->channel()->AddFilter(new ChromeRenderMessageFilter( | 166 host->channel()->AddFilter(new ChromeRenderMessageFilter( |
166 id, profile, profile->GetRequestContextForRenderProcess(id))); | 167 id, profile, profile->GetRequestContextForRenderProcess(id))); |
167 host->channel()->AddFilter(new PrintingMessageFilter()); | 168 host->channel()->AddFilter(new PrintingMessageFilter()); |
168 host->channel()->AddFilter( | 169 host->channel()->AddFilter( |
169 new SearchProviderInstallStateMessageFilter(id, profile)); | 170 new SearchProviderInstallStateMessageFilter(id, profile)); |
170 host->channel()->AddFilter(new SpellCheckMessageFilter(id)); | 171 host->channel()->AddFilter(new SpellCheckMessageFilter(id)); |
172 host->channel()->AddFilter(new ChromeBenchmarkingMessageFilter( | |
173 id, profile, profile->GetRequestContextForRenderProcess(id))); | |
171 | 174 |
172 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( | 175 host->Send(new ChromeViewMsg_SetIsIncognitoProcess( |
173 profile->IsOffTheRecord())); | 176 profile->IsOffTheRecord())); |
174 } | 177 } |
175 | 178 |
176 void ChromeContentBrowserClient::PluginProcessHostCreated( | 179 void ChromeContentBrowserClient::PluginProcessHostCreated( |
177 PluginProcessHost* host) { | 180 PluginProcessHost* host) { |
178 host->AddFilter(new ChromePluginMessageFilter(host)); | 181 host->AddFilter(new ChromePluginMessageFilter(host)); |
179 } | 182 } |
180 | 183 |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
325 switches::kMemoryProfiling, | 328 switches::kMemoryProfiling, |
326 switches::kMessageLoopHistogrammer, | 329 switches::kMessageLoopHistogrammer, |
327 switches::kPpapiFlashArgs, | 330 switches::kPpapiFlashArgs, |
328 switches::kPpapiFlashInProcess, | 331 switches::kPpapiFlashInProcess, |
329 switches::kPpapiFlashPath, | 332 switches::kPpapiFlashPath, |
330 switches::kPpapiFlashVersion, | 333 switches::kPpapiFlashVersion, |
331 switches::kProfilingAtStart, | 334 switches::kProfilingAtStart, |
332 switches::kProfilingFile, | 335 switches::kProfilingFile, |
333 switches::kProfilingFlush, | 336 switches::kProfilingFlush, |
334 switches::kSilentDumpOnDCHECK, | 337 switches::kSilentDumpOnDCHECK, |
338 switches::kEnableBenchmarking, | |
335 }; | 339 }; |
336 | 340 |
337 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 341 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
338 arraysize(kSwitchNames)); | 342 arraysize(kSwitchNames)); |
339 } else if (process_type == switches::kUtilityProcess) { | 343 } else if (process_type == switches::kUtilityProcess) { |
340 if (browser_command_line.HasSwitch( | 344 if (browser_command_line.HasSwitch( |
341 switches::kEnableExperimentalExtensionApis)) { | 345 switches::kEnableExperimentalExtensionApis)) { |
342 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 346 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); |
343 } | 347 } |
344 } else if (process_type == switches::kPluginProcess) { | 348 } else if (process_type == switches::kPluginProcess) { |
(...skipping 13 matching lines...) Expand all Loading... | |
358 switches::kUserDataDir, // Make logs go to the right file. | 362 switches::kUserDataDir, // Make logs go to the right file. |
359 // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox. | 363 // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox. |
360 switches::kPpapiFlashInProcess, | 364 switches::kPpapiFlashInProcess, |
361 switches::kPpapiFlashPath, | 365 switches::kPpapiFlashPath, |
362 switches::kPpapiFlashVersion, | 366 switches::kPpapiFlashVersion, |
363 }; | 367 }; |
364 | 368 |
365 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, | 369 command_line->CopySwitchesFrom(browser_command_line, kSwitchNames, |
366 arraysize(kSwitchNames)); | 370 arraysize(kSwitchNames)); |
367 } | 371 } |
372 | |
373 // The command line switch kEnableBenchmarking needs to be specified along | |
374 // with the kEnableStatsTable switch to ensure that the stats table global | |
375 // is initialized correctly. | |
376 if (command_line->HasSwitch(switches::kEnableBenchmarking)) { | |
jam
2011/09/14 23:47:35
nit: this file doesn't use brackets for one line s
| |
377 DCHECK(command_line->HasSwitch(switches::kEnableStatsTable)); | |
378 } | |
368 } | 379 } |
369 | 380 |
370 std::string ChromeContentBrowserClient::GetApplicationLocale() { | 381 std::string ChromeContentBrowserClient::GetApplicationLocale() { |
371 return g_browser_process->GetApplicationLocale(); | 382 return g_browser_process->GetApplicationLocale(); |
372 } | 383 } |
373 | 384 |
374 std::string ChromeContentBrowserClient::GetAcceptLangs(const TabContents* tab) { | 385 std::string ChromeContentBrowserClient::GetAcceptLangs(const TabContents* tab) { |
375 Profile* profile = Profile::FromBrowserContext(tab->browser_context()); | 386 Profile* profile = Profile::FromBrowserContext(tab->browser_context()); |
376 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages); | 387 return profile->GetPrefs()->GetString(prefs::kAcceptLanguages); |
377 } | 388 } |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
804 #if defined(USE_NSS) | 815 #if defined(USE_NSS) |
805 crypto::CryptoModuleBlockingPasswordDelegate* | 816 crypto::CryptoModuleBlockingPasswordDelegate* |
806 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 817 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
807 const GURL& url) { | 818 const GURL& url) { |
808 return browser::NewCryptoModuleBlockingDialogDelegate( | 819 return browser::NewCryptoModuleBlockingDialogDelegate( |
809 browser::kCryptoModulePasswordKeygen, url.host()); | 820 browser::kCryptoModulePasswordKeygen, url.host()); |
810 } | 821 } |
811 #endif | 822 #endif |
812 | 823 |
813 } // namespace chrome | 824 } // namespace chrome |
OLD | NEW |