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

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

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Really fix. And rebase Created 9 years, 7 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 17 matching lines...) Expand all
28 28
29 namespace content_settings { 29 namespace content_settings {
30 30
31 // //////////////////////////////////////////////////////////////////////////// 31 // ////////////////////////////////////////////////////////////////////////////
32 // NotificationProvider 32 // NotificationProvider
33 // 33 //
34 34
35 // static 35 // static
36 void NotificationProvider::RegisterUserPrefs(PrefService* user_prefs) { 36 void NotificationProvider::RegisterUserPrefs(PrefService* user_prefs) {
37 if (!user_prefs->FindPreference(prefs::kDesktopNotificationAllowedOrigins)) 37 if (!user_prefs->FindPreference(prefs::kDesktopNotificationAllowedOrigins))
38 user_prefs->RegisterListPref(prefs::kDesktopNotificationAllowedOrigins); 38 user_prefs->RegisterListPref(prefs::kDesktopNotificationAllowedOrigins,
39 PrefService::SYNCABLE_PREF);
39 if (!user_prefs->FindPreference(prefs::kDesktopNotificationDeniedOrigins)) 40 if (!user_prefs->FindPreference(prefs::kDesktopNotificationDeniedOrigins))
40 user_prefs->RegisterListPref(prefs::kDesktopNotificationDeniedOrigins); 41 user_prefs->RegisterListPref(prefs::kDesktopNotificationDeniedOrigins,
42 PrefService::SYNCABLE_PREF);
41 } 43 }
42 44
43 // TODO(markusheintz): Re-factoring in progress. Do not move or touch the 45 // TODO(markusheintz): Re-factoring in progress. Do not move or touch the
44 // following two static methods as you might cause trouble. Thanks! 46 // following two static methods as you might cause trouble. Thanks!
45 47
46 // static 48 // static
47 ContentSettingsPattern NotificationProvider::ToContentSettingsPattern( 49 ContentSettingsPattern NotificationProvider::ToContentSettingsPattern(
48 const GURL& origin) { 50 const GURL& origin) {
49 // Fix empty GURLs. 51 // Fix empty GURLs.
50 if (origin.spec().empty()) { 52 if (origin.spec().empty()) {
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 prefs->ScheduleSavePersistentPrefs(); 379 prefs->ScheduleSavePersistentPrefs();
378 } 380 }
379 381
380 void NotificationProvider::ResetAllOrigins() { 382 void NotificationProvider::ResetAllOrigins() {
381 PrefService* prefs = profile_->GetPrefs(); 383 PrefService* prefs = profile_->GetPrefs();
382 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins); 384 prefs->ClearPref(prefs::kDesktopNotificationAllowedOrigins);
383 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins); 385 prefs->ClearPref(prefs::kDesktopNotificationDeniedOrigins);
384 } 386 }
385 387
386 } // namespace content_settings 388 } // namespace content_settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698