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

Unified Diff: chrome/browser/dom_ui/options/content_settings_handler.cc

Issue 6260003: Clear plugin data together with cookies on shutdown. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/dom_ui/options/content_settings_handler.cc
diff --git a/chrome/browser/dom_ui/options/content_settings_handler.cc b/chrome/browser/dom_ui/options/content_settings_handler.cc
index d1bccf81efe1b3f1433bf1ba90baeaf8e496bbb8..7ec78efe251ec1ec372922d2afb042a165ee8eb0 100644
--- a/chrome/browser/dom_ui/options/content_settings_handler.cc
+++ b/chrome/browser/dom_ui/options/content_settings_handler.cc
@@ -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;

Powered by Google App Engine
This is Rietveld 408576698