summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_impl.cc
diff options
context:
space:
mode:
authorgfeher@chromium.org <gfeher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 20:12:09 +0000
committergfeher@chromium.org <gfeher@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-01 20:12:09 +0000
commit2a7e7c15ee743901d9384a08fe6b751b6644f16a (patch)
treea863d5e65767047f3e38ab3d5cdb937e6bac13a9 /chrome/browser/browser_process_impl.cc
parent3491148530fd60dbd8e92cf4ee2954f948cc72d7 (diff)
downloadchromium_src-2a7e7c15ee743901d9384a08fe6b751b6644f16a.zip
chromium_src-2a7e7c15ee743901d9384a08fe6b751b6644f16a.tar.gz
chromium_src-2a7e7c15ee743901d9384a08fe6b751b6644f16a.tar.bz2
Policy to disable printing
Make Chrome refuse to print if the preference kPrintingEnabled is set to false. In this case, the 'Print...' option in the wrench menu is disabled, and if printing is invoked from JavaScript, then Chrome reports that no printer is installed. Changes to this preference after startup are also respected. BUG=54380 TEST=manual Review URL: http://codereview.chromium.org/3357011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61222 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r--chrome/browser/browser_process_impl.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 88b41a9..7201c08 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -638,12 +638,22 @@ void BrowserProcessImpl::CreateLocalState() {
PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path);
local_state_.reset(PrefService::CreatePrefService(local_state_path, NULL));
+ pref_change_registrar_.Init(local_state_.get());
+
// Make sure the the plugin updater gets notifications of changes
// in the plugin blacklist.
local_state_->RegisterListPref(prefs::kPluginsPluginsBlacklist);
- plugin_state_change_registrar_.Init(local_state_.get());
- plugin_state_change_registrar_.Add(prefs::kPluginsPluginsBlacklist,
- PluginUpdater::GetPluginUpdater());
+ pref_change_registrar_.Add(prefs::kPluginsPluginsBlacklist,
+ PluginUpdater::GetPluginUpdater());
+
+ // Initialize and set up notifications for the printing enabled
+ // preference.
+ local_state_->RegisterBooleanPref(prefs::kPrintingEnabled, true);
+ bool printing_enabled =
+ local_state_->GetBoolean(prefs::kPrintingEnabled);
+ print_job_manager_->set_printing_enabled(printing_enabled);
+ pref_change_registrar_.Add(prefs::kPrintingEnabled,
+ print_job_manager_.get());
}
void BrowserProcessImpl::CreateIconManager() {