| OLD | NEW |
| 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 #include "chrome/browser/background_page_tracker.h" | 5 #include "chrome/browser/background_page_tracker.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 // | 34 // |
| 35 // kKnownBackgroundPages: | 35 // kKnownBackgroundPages: |
| 36 // DictionaryValue { | 36 // DictionaryValue { |
| 37 // <appid_1>: false, | 37 // <appid_1>: false, |
| 38 // <appid_2>: true, | 38 // <appid_2>: true, |
| 39 // ... etc ... | 39 // ... etc ... |
| 40 // } | 40 // } |
| 41 | 41 |
| 42 // static | 42 // static |
| 43 void BackgroundPageTracker::RegisterPrefs(PrefService* prefs) { | 43 void BackgroundPageTracker::RegisterPrefs(PrefService* prefs) { |
| 44 prefs->RegisterDictionaryPref(prefs::kKnownBackgroundPages); | 44 prefs->RegisterDictionaryPref(prefs::kKnownBackgroundPages, |
| 45 false /* don't sync pref */); |
| 45 } | 46 } |
| 46 | 47 |
| 47 // static | 48 // static |
| 48 BackgroundPageTracker* BackgroundPageTracker::GetInstance() { | 49 BackgroundPageTracker* BackgroundPageTracker::GetInstance() { |
| 49 return Singleton<BackgroundPageTracker>::get(); | 50 return Singleton<BackgroundPageTracker>::get(); |
| 50 } | 51 } |
| 51 | 52 |
| 52 int BackgroundPageTracker::GetBackgroundPageCount() { | 53 int BackgroundPageTracker::GetBackgroundPageCount() { |
| 53 if (!IsEnabled()) | 54 if (!IsEnabled()) |
| 54 return 0; | 55 return 0; |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 prefs->ScheduleSavePersistentPrefs(); | 293 prefs->ScheduleSavePersistentPrefs(); |
| 293 SendChangeNotification(); | 294 SendChangeNotification(); |
| 294 } | 295 } |
| 295 | 296 |
| 296 void BackgroundPageTracker::SendChangeNotification() { | 297 void BackgroundPageTracker::SendChangeNotification() { |
| 297 NotificationService::current()->Notify( | 298 NotificationService::current()->Notify( |
| 298 NotificationType::BACKGROUND_PAGE_TRACKER_CHANGED, | 299 NotificationType::BACKGROUND_PAGE_TRACKER_CHANGED, |
| 299 Source<BackgroundPageTracker>(this), | 300 Source<BackgroundPageTracker>(this), |
| 300 NotificationService::NoDetails()); | 301 NotificationService::NoDetails()); |
| 301 } | 302 } |
| OLD | NEW |