Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 10808006: Move printing.* prefs from local state to profile (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased just in case as the CL is a few days old now plus I got my branches all mixed up a bit. Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/prefs/browser_prefs.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698