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

Side by Side Diff: chrome/browser/content_settings/content_settings_notification_provider.cc

Issue 7649006: more changes (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another typo Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 #include "chrome/browser/content_settings/content_settings_notification_provider .h" 6 #include "chrome/browser/content_settings/content_settings_notification_provider .h"
7 7
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "chrome/browser/notifications/desktop_notification_service_factory.h" 9 #include "chrome/browser/notifications/desktop_notification_service_factory.h"
10 #include "chrome/browser/notifications/notification.h" 10 #include "chrome/browser/notifications/notification.h"
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 bool denied_changed = false; 269 bool denied_changed = false;
270 270
271 { 271 {
272 ListPrefUpdate update_allowed_sites( 272 ListPrefUpdate update_allowed_sites(
273 prefs, prefs::kDesktopNotificationAllowedOrigins); 273 prefs, prefs::kDesktopNotificationAllowedOrigins);
274 ListPrefUpdate update_denied_sites( 274 ListPrefUpdate update_denied_sites(
275 prefs, prefs::kDesktopNotificationDeniedOrigins); 275 prefs, prefs::kDesktopNotificationDeniedOrigins);
276 ListValue* allowed_sites = update_allowed_sites.Get(); 276 ListValue* allowed_sites = update_allowed_sites.Get();
277 ListValue* denied_sites = update_denied_sites.Get(); 277 ListValue* denied_sites = update_denied_sites.Get();
278 // |value| is passed to the preferences list, or deleted. 278 // |value| is passed to the preferences list, or deleted.
279 StringValue* value = new StringValue(origin.spec()); 279 StringValue* value = base::StringValue::New(origin.spec());
280 280
281 // Remove from one list and add to the other. 281 // Remove from one list and add to the other.
282 if (is_allowed) { 282 if (is_allowed) {
283 // Remove from the denied list. 283 // Remove from the denied list.
284 if (denied_sites->Remove(*value, NULL)) 284 if (denied_sites->Remove(*value, NULL))
285 denied_changed = true; 285 denied_changed = true;
286 286
287 // Add to the allowed list. 287 // Add to the allowed list.
288 if (allowed_sites->AppendIfNotPresent(value)) 288 if (allowed_sites->AppendIfNotPresent(value))
289 allowed_changed = true; 289 allowed_changed = true;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 prefs->ScheduleSavePersistentPrefs(); 359 prefs->ScheduleSavePersistentPrefs();
360 } 360 }
361 361
362 void NotificationProvider::ResetAllOrigins() { 362 void NotificationProvider::ResetAllOrigins() {
363 PrefService* prefs = profile_->GetPrefs(); 363 PrefService* prefs = profile_->GetPrefs();
364 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins); 364 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins);
365 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins); 365 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins);
366 } 366 }
367 367
368 } // namespace content_settings 368 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698