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 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 OnBackgroundPageLoaded(id); | 158 OnBackgroundPageLoaded(id); |
159 break; | 159 break; |
160 } | 160 } |
161 case NotificationType::EXTENSION_LOADED: { | 161 case NotificationType::EXTENSION_LOADED: { |
162 const Extension* extension = Details<const Extension>(details).ptr(); | 162 const Extension* extension = Details<const Extension>(details).ptr(); |
163 if (extension->background_url().is_valid()) | 163 if (extension->background_url().is_valid()) |
164 OnBackgroundPageLoaded(extension->id()); | 164 OnBackgroundPageLoaded(extension->id()); |
165 break; | 165 break; |
166 } | 166 } |
167 case NotificationType::EXTENSION_UNLOADED: { | 167 case NotificationType::EXTENSION_UNLOADED: { |
168 std::string id = Details<const Extension>(details)->id(); | 168 std::string id = Details<UnloadedExtensionInfo>(details)->extension->id(); |
169 OnExtensionUnloaded(id); | 169 OnExtensionUnloaded(id); |
170 break; | 170 break; |
171 } | 171 } |
172 default: | 172 default: |
173 NOTREACHED(); | 173 NOTREACHED(); |
174 } | 174 } |
175 } | 175 } |
176 | 176 |
177 bool BackgroundPageTracker::UpdateExtensionList() { | 177 bool BackgroundPageTracker::UpdateExtensionList() { |
178 // Extensions are loaded - update our list. | 178 // Extensions are loaded - update our list. |
(...skipping 107 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 |