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 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 442 } |
443 | 443 |
444 void ChromeContentBrowserClient::RenderProcessHostCreated( | 444 void ChromeContentBrowserClient::RenderProcessHostCreated( |
445 content::RenderProcessHost* host) { | 445 content::RenderProcessHost* host) { |
446 int id = host->GetID(); | 446 int id = host->GetID(); |
447 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); | 447 Profile* profile = Profile::FromBrowserContext(host->GetBrowserContext()); |
448 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( | 448 host->GetChannel()->AddFilter(new ChromeRenderMessageFilter( |
449 id, profile, profile->GetRequestContextForRenderProcess(id))); | 449 id, profile, profile->GetRequestContextForRenderProcess(id))); |
450 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); | 450 host->GetChannel()->AddFilter(new PluginInfoMessageFilter(id, profile)); |
451 #if defined(ENABLE_PRINTING) | 451 #if defined(ENABLE_PRINTING) |
452 host->GetChannel()->AddFilter(new PrintingMessageFilter(id)); | 452 host->GetChannel()->AddFilter(new PrintingMessageFilter(id, profile)); |
453 #endif | 453 #endif |
454 host->GetChannel()->AddFilter( | 454 host->GetChannel()->AddFilter( |
455 new SearchProviderInstallStateMessageFilter(id, profile)); | 455 new SearchProviderInstallStateMessageFilter(id, profile)); |
456 host->GetChannel()->AddFilter(new SpellCheckMessageFilter(id)); | 456 host->GetChannel()->AddFilter(new SpellCheckMessageFilter(id)); |
457 #if defined(OS_MACOSX) | 457 #if defined(OS_MACOSX) |
458 host->GetChannel()->AddFilter(new SpellCheckMessageFilterMac()); | 458 host->GetChannel()->AddFilter(new SpellCheckMessageFilterMac()); |
459 #endif | 459 #endif |
460 host->GetChannel()->AddFilter(new ChromeBenchmarkingMessageFilter( | 460 host->GetChannel()->AddFilter(new ChromeBenchmarkingMessageFilter( |
461 id, profile, profile->GetRequestContextForRenderProcess(id))); | 461 id, profile, profile->GetRequestContextForRenderProcess(id))); |
462 host->GetChannel()->AddFilter( | 462 host->GetChannel()->AddFilter( |
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 command_line->AppendSwitch(switches::kDisable3DAPIs); | 786 command_line->AppendSwitch(switches::kDisable3DAPIs); |
787 } | 787 } |
788 | 788 |
789 // Disable client-side phishing detection in the renderer if it is | 789 // Disable client-side phishing detection in the renderer if it is |
790 // disabled in the Profile preferences or the browser process. | 790 // disabled in the Profile preferences or the browser process. |
791 if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) || | 791 if (!prefs->GetBoolean(prefs::kSafeBrowsingEnabled) || |
792 !g_browser_process->safe_browsing_detection_service()) { | 792 !g_browser_process->safe_browsing_detection_service()) { |
793 command_line->AppendSwitch( | 793 command_line->AppendSwitch( |
794 switches::kDisableClientSidePhishingDetection); | 794 switches::kDisableClientSidePhishingDetection); |
795 } | 795 } |
796 } | 796 |
797 { | 797 if (!prefs->GetBoolean(prefs::kPrintPreviewDisabled)) |
798 PrefService* local_state = g_browser_process->local_state(); | |
799 if (local_state && | |
800 !local_state->GetBoolean(prefs::kPrintPreviewDisabled)) { | |
801 command_line->AppendSwitch(switches::kRendererPrintPreview); | 798 command_line->AppendSwitch(switches::kRendererPrintPreview); |
802 } | |
803 } | 799 } |
804 | 800 |
805 // Please keep this in alphabetical order. | 801 // Please keep this in alphabetical order. |
806 static const char* const kSwitchNames[] = { | 802 static const char* const kSwitchNames[] = { |
807 switches::kAllowHTTPBackgroundPage, | 803 switches::kAllowHTTPBackgroundPage, |
808 switches::kAllowLegacyExtensionManifests, | 804 switches::kAllowLegacyExtensionManifests, |
809 switches::kAllowScriptingGallery, | 805 switches::kAllowScriptingGallery, |
810 switches::kAppsCheckoutURL, | 806 switches::kAppsCheckoutURL, |
811 switches::kAppsGalleryURL, | 807 switches::kAppsGalleryURL, |
812 switches::kCloudPrintServiceURL, | 808 switches::kCloudPrintServiceURL, |
(...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1666 io_thread_application_locale_ = locale; | 1662 io_thread_application_locale_ = locale; |
1667 } | 1663 } |
1668 | 1664 |
1669 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1665 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
1670 const std::string& locale) { | 1666 const std::string& locale) { |
1671 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1667 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1672 io_thread_application_locale_ = locale; | 1668 io_thread_application_locale_ = locale; |
1673 } | 1669 } |
1674 | 1670 |
1675 } // namespace chrome | 1671 } // namespace chrome |
OLD | NEW |