diff options
author | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 12:50:24 +0000 |
---|---|---|
committer | bauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 12:50:24 +0000 |
commit | 2ffc3c6cf5e8eb1130f8be0c09eed158e8eb9c67 (patch) | |
tree | 044bc2981ca69141a9c8fc0803cafe868f39d5aa /chrome/browser/dom_ui | |
parent | e0e4d726eba85f312c0d219f7ba302398a34d3d2 (diff) | |
download | chromium_src-2ffc3c6cf5e8eb1130f8be0c09eed158e8eb9c67.zip chromium_src-2ffc3c6cf5e8eb1130f8be0c09eed158e8eb9c67.tar.gz chromium_src-2ffc3c6cf5e8eb1130f8be0c09eed158e8eb9c67.tar.bz2 |
Clear plugin data together with cookies on shutdown.
BUG=58235
TEST=none
Review URL: http://codereview.chromium.org/6260003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71436 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui')
-rw-r--r-- | chrome/browser/dom_ui/options/content_settings_handler.cc | 22 | ||||
-rw-r--r-- | chrome/browser/dom_ui/options/content_settings_handler.h | 6 |
2 files changed, 24 insertions, 4 deletions
diff --git a/chrome/browser/dom_ui/options/content_settings_handler.cc b/chrome/browser/dom_ui/options/content_settings_handler.cc index d1bccf81..3220127 100644 --- a/chrome/browser/dom_ui/options/content_settings_handler.cc +++ b/chrome/browser/dom_ui/options/content_settings_handler.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -10,6 +10,7 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_list.h" +#include "chrome/browser/browser_process.h" #include "chrome/browser/content_settings/content_settings_details.h" #include "chrome/browser/content_settings/host_content_settings_map.h" #include "chrome/browser/geolocation/geolocation_content_settings_map.h" @@ -216,8 +217,6 @@ void ContentSettingsHandler::GetLocalizedValues( l10n_util::GetStringUTF16(IDS_COOKIES_BLOCK_RADIO)); localized_strings->SetString("cookies_block_3rd_party", l10n_util::GetStringUTF16(IDS_COOKIES_BLOCK_3RDPARTY_CHKBOX)); - localized_strings->SetString("cookies_clear_on_exit", - l10n_util::GetStringUTF16(IDS_COOKIES_CLEAR_WHEN_CLOSE_CHKBOX)); localized_strings->SetString("cookies_show_cookies", l10n_util::GetStringUTF16(IDS_COOKIES_SHOW_COOKIES_BUTTON)); localized_strings->SetString("flash_storage_settings", @@ -304,6 +303,11 @@ void ContentSettingsHandler::Initialize() { dom_ui_->CallJavascriptFunction( L"ContentSettings.setBlockThirdPartyCookies", *block_3rd_party.get()); + clear_plugin_lso_data_enabled_.Init(prefs::kClearPluginLSODataEnabled, + g_browser_process->local_state(), + this); + UpdateClearPluginLSOData(); + notification_registrar_.Add( this, NotificationType::OTR_PROFILE_CREATED, NotificationService::AllSources()); @@ -364,6 +368,8 @@ void ContentSettingsHandler::Observe(NotificationType type, UpdateSettingDefaultFromModel(CONTENT_SETTINGS_TYPE_GEOLOCATION); else if (pref_name == prefs::kGeolocationContentSettings) UpdateGeolocationExceptionsView(); + else if (pref_name == prefs::kClearPluginLSODataEnabled) + UpdateClearPluginLSOData(); break; } @@ -382,6 +388,16 @@ void ContentSettingsHandler::Observe(NotificationType type, } } +void ContentSettingsHandler::UpdateClearPluginLSOData() { + int label_id = clear_plugin_lso_data_enabled_.GetValue() ? + IDS_COOKIES_LSO_CLEAR_WHEN_CLOSE_CHKBOX : + IDS_COOKIES_CLEAR_WHEN_CLOSE_CHKBOX; + scoped_ptr<Value> label( + Value::CreateStringValue(l10n_util::GetStringUTF16(label_id))); + dom_ui_->CallJavascriptFunction( + L"ContentSettings.setClearLocalDataOnShutdownLabel", *label); +} + void ContentSettingsHandler::UpdateSettingDefaultFromModel( ContentSettingsType type) { DictionaryValue filter_settings; diff --git a/chrome/browser/dom_ui/options/content_settings_handler.h b/chrome/browser/dom_ui/options/content_settings_handler.h index 1542539..f85ef68 100644 --- a/chrome/browser/dom_ui/options/content_settings_handler.h +++ b/chrome/browser/dom_ui/options/content_settings_handler.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -7,6 +7,7 @@ #pragma once #include "chrome/browser/dom_ui/options/options_ui.h" +#include "chrome/browser/plugin_data_remover_helper.h" #include "chrome/browser/prefs/pref_change_registrar.h" #include "chrome/common/content_settings_types.h" #include "chrome/common/notification_observer.h" @@ -39,6 +40,8 @@ class ContentSettingsHandler : public OptionsPageUIHandler { // Updates the page with the default settings (allow, ask, block, etc.) void UpdateSettingDefaultFromModel(ContentSettingsType type); + // Updates the state of the "Clear plugin LSO data on exit" checkbox. + void UpdateClearPluginLSOData(); // Clobbers and rebuilds the specific content setting type exceptions table. void UpdateExceptionsViewFromModel(ContentSettingsType type); @@ -104,6 +107,7 @@ class ContentSettingsHandler : public OptionsPageUIHandler { NotificationRegistrar notification_registrar_; PrefChangeRegistrar pref_change_registrar_; + PluginDataRemoverHelper clear_plugin_lso_data_enabled_; DISALLOW_COPY_AND_ASSIGN(ContentSettingsHandler); }; |