| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 // <appid_2>: true, | 35 // <appid_2>: true, |
| 36 // ... etc ... | 36 // ... etc ... |
| 37 // } | 37 // } |
| 38 | 38 |
| 39 // static | 39 // static |
| 40 void BackgroundPageTracker::RegisterPrefs(PrefService* prefs) { | 40 void BackgroundPageTracker::RegisterPrefs(PrefService* prefs) { |
| 41 prefs->RegisterDictionaryPref(prefs::kKnownBackgroundPages); | 41 prefs->RegisterDictionaryPref(prefs::kKnownBackgroundPages); |
| 42 } | 42 } |
| 43 | 43 |
| 44 // static | 44 // static |
| 45 BackgroundPageTracker* BackgroundPageTracker::GetSingleton() { | 45 BackgroundPageTracker* BackgroundPageTracker::GetInstance() { |
| 46 return Singleton<BackgroundPageTracker>::get(); | 46 return Singleton<BackgroundPageTracker>::get(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 int BackgroundPageTracker::GetBackgroundPageCount() { | 49 int BackgroundPageTracker::GetBackgroundPageCount() { |
| 50 if (!IsEnabled()) | 50 if (!IsEnabled()) |
| 51 return 0; | 51 return 0; |
| 52 | 52 |
| 53 PrefService* prefs = GetPrefService(); | 53 PrefService* prefs = GetPrefService(); |
| 54 const DictionaryValue* contents = | 54 const DictionaryValue* contents = |
| 55 prefs->GetDictionary(prefs::kKnownBackgroundPages); | 55 prefs->GetDictionary(prefs::kKnownBackgroundPages); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 prefs->ScheduleSavePersistentPrefs(); | 286 prefs->ScheduleSavePersistentPrefs(); |
| 287 SendChangeNotification(); | 287 SendChangeNotification(); |
| 288 } | 288 } |
| 289 | 289 |
| 290 void BackgroundPageTracker::SendChangeNotification() { | 290 void BackgroundPageTracker::SendChangeNotification() { |
| 291 NotificationService::current()->Notify( | 291 NotificationService::current()->Notify( |
| 292 NotificationType::BACKGROUND_PAGE_TRACKER_CHANGED, | 292 NotificationType::BACKGROUND_PAGE_TRACKER_CHANGED, |
| 293 Source<BackgroundPageTracker>(this), | 293 Source<BackgroundPageTracker>(this), |
| 294 NotificationService::NoDetails()); | 294 NotificationService::NoDetails()); |
| 295 } | 295 } |
| OLD | NEW |