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/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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 const Extension* extension_; | 65 const Extension* extension_; |
66 scoped_ptr<SkBitmap> icon_; | 66 scoped_ptr<SkBitmap> icon_; |
67 BackgroundApplicationListModel* model_; | 67 BackgroundApplicationListModel* model_; |
68 ImageLoadingTracker tracker_; | 68 ImageLoadingTracker tracker_; |
69 }; | 69 }; |
70 | 70 |
71 namespace { | 71 namespace { |
72 void GetServiceApplications(ExtensionService* service, | 72 void GetServiceApplications(ExtensionService* service, |
73 ExtensionList* applications_result) { | 73 ExtensionList* applications_result) { |
74 const ExtensionList* extensions = service->extensions(); | 74 const ExtensionSet* extensions = service->extensions(); |
75 | 75 |
76 for (ExtensionList::const_iterator cursor = extensions->begin(); | 76 for (ExtensionSet::const_iterator cursor = extensions->begin(); |
77 cursor != extensions->end(); | 77 cursor != extensions->end(); |
78 ++cursor) { | 78 ++cursor) { |
79 const Extension* extension = *cursor; | 79 const Extension* extension = *cursor; |
80 if (BackgroundApplicationListModel::IsBackgroundApp(*extension)) | 80 if (BackgroundApplicationListModel::IsBackgroundApp(*extension)) |
81 applications_result->push_back(extension); | 81 applications_result->push_back(extension); |
82 } | 82 } |
83 | 83 |
84 // Walk the list of terminated extensions also (just because an extension | 84 // Walk the list of terminated extensions also (just because an extension |
85 // crashed doesn't mean we should ignore it). | 85 // crashed doesn't mean we should ignore it). |
86 extensions = service->terminated_extensions(); | 86 extensions = service->terminated_extensions(); |
87 for (ExtensionList::const_iterator cursor = extensions->begin(); | 87 for (ExtensionSet::const_iterator cursor = extensions->begin(); |
88 cursor != extensions->end(); | 88 cursor != extensions->end(); |
89 ++cursor) { | 89 ++cursor) { |
90 const Extension* extension = *cursor; | 90 const Extension* extension = *cursor; |
91 if (BackgroundApplicationListModel::IsBackgroundApp(*extension)) | 91 if (BackgroundApplicationListModel::IsBackgroundApp(*extension)) |
92 applications_result->push_back(extension); | 92 applications_result->push_back(extension); |
93 } | 93 } |
94 | 94 |
95 std::string locale = g_browser_process->GetApplicationLocale(); | 95 std::string locale = g_browser_process->GetApplicationLocale(); |
96 icu::Locale loc(locale.c_str()); | 96 icu::Locale loc(locale.c_str()); |
97 UErrorCode error = U_ZERO_ERROR; | 97 UErrorCode error = U_ZERO_ERROR; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 (*old_cursor)->name() == (*new_cursor)->name() && | 349 (*old_cursor)->name() == (*new_cursor)->name() && |
350 (*old_cursor)->id() == (*new_cursor)->id()) { | 350 (*old_cursor)->id() == (*new_cursor)->id()) { |
351 ++old_cursor; | 351 ++old_cursor; |
352 ++new_cursor; | 352 ++new_cursor; |
353 } | 353 } |
354 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { | 354 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { |
355 extensions_ = extensions; | 355 extensions_ = extensions; |
356 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); | 356 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); |
357 } | 357 } |
358 } | 358 } |
OLD | NEW |