summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/options/content_settings_handler.cc
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 21:58:46 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-07 21:58:46 +0000
commit912fee76d9a90bf184f1b985a4dcc1898c3fbe6c (patch)
treec088f1f6d76fff6af26af3236f40b1fb3f6d6b4e /chrome/browser/dom_ui/options/content_settings_handler.cc
parent4419bbe525d2d15b5261e48113360c27a81c9535 (diff)
downloadchromium_src-912fee76d9a90bf184f1b985a4dcc1898c3fbe6c.zip
chromium_src-912fee76d9a90bf184f1b985a4dcc1898c3fbe6c.tar.gz
chromium_src-912fee76d9a90bf184f1b985a4dcc1898c3fbe6c.tar.bz2
Add placeholder text to DOM UI content settings exceptions <input>.
The actual placeholder attribute doesn't work because it disappears when the <input> is focused, and the <input> is focused as soon as it appears, so the text is placed as the contents of the <input>. Adding a new row should show [*.]example.com, and it should start as selected. Pressing enter in this one case should delete the row rather than inserting a [*.]example.com exception. Pressing escape in all cases should revert the row (delete it for Add'd rows). BUG=35087, 57458 TEST=manual Review URL: http://codereview.chromium.org/3573009 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@61860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/options/content_settings_handler.cc')
-rw-r--r--chrome/browser/dom_ui/options/content_settings_handler.cc39
1 files changed, 13 insertions, 26 deletions
diff --git a/chrome/browser/dom_ui/options/content_settings_handler.cc b/chrome/browser/dom_ui/options/content_settings_handler.cc
index 2a21f27..f3b21f54 100644
--- a/chrome/browser/dom_ui/options/content_settings_handler.cc
+++ b/chrome/browser/dom_ui/options/content_settings_handler.cc
@@ -175,6 +175,8 @@ void ContentSettingsHandler::GetLocalizedValues(
l10n_util::GetStringUTF16(IDS_EXCEPTIONS_EDIT_BUTTON));
localized_strings->SetString("otr_exceptions_explanation",
l10n_util::GetStringUTF16(IDS_EXCEPTIONS_OTR_LABEL));
+ localized_strings->SetString("examplePattern",
+ l10n_util::GetStringUTF16(IDS_EXCEPTIONS_PATTERN_EXAMPLE));
// Cookies filter.
localized_strings->SetString("cookies_tab_label",
@@ -278,37 +280,22 @@ void ContentSettingsHandler::Initialize() {
notification_registrar_.Add(
this, NotificationType::CONTENT_SETTINGS_CHANGED,
Source<const HostContentSettingsMap>(settings_map));
- notification_registrar_.Add(
- this, NotificationType::GEOLOCATION_SETTINGS_CHANGED,
- NotificationService::AllSources());
}
void ContentSettingsHandler::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
- switch (type.value) {
- case NotificationType::CONTENT_SETTINGS_CHANGED: {
- const ContentSettingsDetails* settings_details =
- static_cast<Details<const ContentSettingsDetails> >(details).ptr();
-
- // TODO(estade): we pretend update_all() is always true.
- if (settings_details->update_all_types())
- UpdateAllExceptionsViewsFromModel();
- else
- UpdateExceptionsViewFromModel(settings_details->type());
- break;
- }
- case NotificationType::GEOLOCATION_SETTINGS_CHANGED: {
- UpdateGeolocationExceptionsView();
- break;
- }
- case NotificationType::DESKTOP_NOTIFICATION_SETTINGS_CHANGED: {
- UpdateNotificationExceptionsView();
- break;
- }
- default:
- OptionsPageUIHandler::Observe(type, source, details);
- }
+ if (type != NotificationType::CONTENT_SETTINGS_CHANGED)
+ return OptionsPageUIHandler::Observe(type, source, details);
+
+ const ContentSettingsDetails* settings_details =
+ static_cast<Details<const ContentSettingsDetails> >(details).ptr();
+
+ // TODO(estade): we pretend update_all() is always true.
+ if (settings_details->update_all_types())
+ UpdateAllExceptionsViewsFromModel();
+ else
+ UpdateExceptionsViewFromModel(settings_details->type());
}
void ContentSettingsHandler::UpdateSettingDefaultFromModel(