Skip to content
Snippets Groups Projects
Commit 2ffc3c6c authored by bauerb@chromium.org's avatar bauerb@chromium.org
Browse files

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
parent e0e4d726
No related merge requests found
......@@ -5225,11 +5225,17 @@ Keep your key file in a safe place. You will need it to create new versions of y
<message name="IDS_COOKIES_CLEAR_WHEN_CLOSE_CHKBOX" desc="A checkbox in the Content Settings dialog for removing all cookies on when browser is closed.">
Clear cookies and other site data when I close my browser
</message>
<message name="IDS_COOKIES_LSO_CLEAR_WHEN_CLOSE_CHKBOX" desc="A checkbox in the Content Settings dialog for removing all cookies on when browser is closed.">
Clear cookies and other site and plug-in data when I close my browser
</message>
</if>
<if expr="os == 'darwin'">
<message name="IDS_COOKIES_CLEAR_WHEN_CLOSE_CHKBOX" desc="A checkbox in the Content Settings dialog for removing all cookies on when browser is quit (Mac).">
Clear cookies and other site data when I quit my browser
</message>
<message name="IDS_COOKIES_LSO_CLEAR_WHEN_CLOSE_CHKBOX" desc="A checkbox in the Content Settings dialog for removing all cookies on when browser is quit (Mac).">
Clear cookies and other site and plug-in data when I quit my browser
</message>
</if>
 
<message name="IDS_IMAGES_TAB_LABEL" desc="Label for Images tab on Content Settings dialog">
......
......@@ -539,7 +539,7 @@ void BrowserProcessImpl::Observe(NotificationType type,
Profile* profile = ProfileManager::GetDefaultProfile();
if (profile) {
PrefService* prefs = profile->GetPrefs();
if (prefs->GetBoolean(prefs::kClearPluginLSODataOnExit) &&
if (prefs->GetBoolean(prefs::kClearSiteDataOnExit) &&
local_state()->GetBoolean(prefs::kClearPluginLSODataEnabled)) {
plugin_data_remover_ = new PluginDataRemover();
plugin_data_remover_->StartRemoving(base::Time(), NULL);
......
// 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;
......
// 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);
};
......
......@@ -21,7 +21,7 @@
<label class="checkbox">
<input id="clear-cookies-on-exit"
pref="profile.clear_site_data_on_exit" type="checkbox">
<span i18n-content="cookies_clear_on_exit"></span>
<span id="clear-cookies-on-exit-label"></span>
</label>
<button class="exceptions-list-button" contentType="cookies"
......
......@@ -135,6 +135,10 @@ cr.define('options', function() {
exceptionsList.patternValidityCheckComplete(pattern, valid);
};
ContentSettings.setClearLocalDataOnShutdownLabel = function(label) {
$('clear-cookies-on-exit-label').innerText = label;
};
// Export
return {
ContentSettings: ContentSettings
......
......@@ -1990,7 +1990,6 @@ void Browser::RegisterUserPrefs(PrefService* prefs) {
chrome::kChromeUINewTabURL);
prefs->RegisterBooleanPref(prefs::kHomePageIsNewTabPage, true);
prefs->RegisterBooleanPref(prefs::kClearSiteDataOnExit, false);
prefs->RegisterBooleanPref(prefs::kClearPluginLSODataOnExit, false);
prefs->RegisterBooleanPref(prefs::kShowHomeButton, false);
#if defined(OS_MACOSX)
// This really belongs in platform code, but there's no good place to
......
......@@ -27,7 +27,6 @@ void OptionsUtil::ResetToDefaults(Profile* profile) {
const char* kUserPrefs[] = {
prefs::kAcceptLanguages,
prefs::kAlternateErrorPagesEnabled,
prefs::kClearPluginLSODataOnExit,
prefs::kClearSiteDataOnExit,
prefs::kCookieBehavior,
prefs::kDefaultCharset,
......
......@@ -593,11 +593,6 @@ const char kBlockNonsandboxedPlugins[] = "profile.block_nonsandboxed_plugins";
// storage, etc..) should be deleted on exit.
const char kClearSiteDataOnExit[] = "profile.clear_site_data_on_exit";
// Boolean that is true when plug-in locally stored data ("Flash cookies")
// should be deleted on exit.
const char kClearPluginLSODataOnExit[] =
"profile.clear_plugin_lso_data_on_exit";
// Double that indicates the default zoom level.
const char kDefaultZoomLevel[] = "profile.default_zoom_level";
......
......@@ -220,7 +220,6 @@ extern const char kContentSettingsPatterns[];
extern const char kBlockThirdPartyCookies[];
extern const char kBlockNonsandboxedPlugins[];
extern const char kClearSiteDataOnExit[];
extern const char kClearPluginLSODataOnExit[];
extern const char kDefaultZoomLevel[];
extern const char kPerHostZoomLevels[];
extern const char kAutoFillEnabled[];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment