| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/background_application_list_model.h" | 5 #include "chrome/browser/background/background_application_list_model.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/sha1.h" | 10 #include "base/sha1.h" |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 // as background apps. | 309 // as background apps. |
| 310 if (!extension.is_hosted_app()) | 310 if (!extension.is_hosted_app()) |
| 311 return true; | 311 return true; |
| 312 | 312 |
| 313 // Hosted apps with manifest-provided background pages are background apps. | 313 // Hosted apps with manifest-provided background pages are background apps. |
| 314 if (extensions::BackgroundInfo::HasBackgroundPage(&extension)) | 314 if (extensions::BackgroundInfo::HasBackgroundPage(&extension)) |
| 315 return true; | 315 return true; |
| 316 | 316 |
| 317 BackgroundContentsService* service = | 317 BackgroundContentsService* service = |
| 318 BackgroundContentsServiceFactory::GetForProfile(profile); | 318 BackgroundContentsServiceFactory::GetForProfile(profile); |
| 319 string16 app_id = ASCIIToUTF16(extension.id()); | 319 base::string16 app_id = ASCIIToUTF16(extension.id()); |
| 320 // If we have an active or registered background contents for this app, then | 320 // If we have an active or registered background contents for this app, then |
| 321 // it's a background app. This covers the cases where the app has created its | 321 // it's a background app. This covers the cases where the app has created its |
| 322 // background contents, but it hasn't navigated yet, or the background | 322 // background contents, but it hasn't navigated yet, or the background |
| 323 // contents crashed and hasn't yet been restarted - in both cases we still | 323 // contents crashed and hasn't yet been restarted - in both cases we still |
| 324 // want to treat the app as a background app. | 324 // want to treat the app as a background app. |
| 325 if (service->GetAppBackgroundContents(app_id) || | 325 if (service->GetAppBackgroundContents(app_id) || |
| 326 service->HasRegisteredBackgroundContents(app_id)) { | 326 service->HasRegisteredBackgroundContents(app_id)) { |
| 327 return true; | 327 return true; |
| 328 } | 328 } |
| 329 | 329 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 (*old_cursor)->name() == (*new_cursor)->name() && | 433 (*old_cursor)->name() == (*new_cursor)->name() && |
| 434 (*old_cursor)->id() == (*new_cursor)->id()) { | 434 (*old_cursor)->id() == (*new_cursor)->id()) { |
| 435 ++old_cursor; | 435 ++old_cursor; |
| 436 ++new_cursor; | 436 ++new_cursor; |
| 437 } | 437 } |
| 438 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { | 438 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { |
| 439 extensions_ = extensions; | 439 extensions_ = extensions; |
| 440 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); | 440 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); |
| 441 } | 441 } |
| 442 } | 442 } |
| OLD | NEW |