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_application_list_model.h" | 5 #include "chrome/browser/background_application_list_model.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/l10n_util_collator.h" | 9 #include "app/l10n_util_collator.h" |
10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 Source<Profile>(profile)); | 148 Source<Profile>(profile)); |
149 registrar_.Add(this, | 149 registrar_.Add(this, |
150 NotificationType::EXTENSION_UNLOADED, | 150 NotificationType::EXTENSION_UNLOADED, |
151 Source<Profile>(profile)); | 151 Source<Profile>(profile)); |
152 registrar_.Add(this, | 152 registrar_.Add(this, |
153 NotificationType::EXTENSION_UNLOADED_DISABLED, | 153 NotificationType::EXTENSION_UNLOADED_DISABLED, |
154 Source<Profile>(profile)); | 154 Source<Profile>(profile)); |
155 registrar_.Add(this, | 155 registrar_.Add(this, |
156 NotificationType::EXTENSIONS_READY, | 156 NotificationType::EXTENSIONS_READY, |
157 Source<Profile>(profile)); | 157 Source<Profile>(profile)); |
| 158 ExtensionService* service = profile->GetExtensionService(); |
| 159 if (service && service->is_ready()) |
| 160 Update(); |
158 } | 161 } |
159 | 162 |
160 void BackgroundApplicationListModel::AddObserver(Observer* observer) { | 163 void BackgroundApplicationListModel::AddObserver(Observer* observer) { |
161 observers_.AddObserver(observer); | 164 observers_.AddObserver(observer); |
162 } | 165 } |
163 | 166 |
164 void BackgroundApplicationListModel::AssociateApplicationData( | 167 void BackgroundApplicationListModel::AssociateApplicationData( |
165 const Extension* extension) { | 168 const Extension* extension) { |
166 DCHECK(IsBackgroundApp(*extension)); | 169 DCHECK(IsBackgroundApp(*extension)); |
167 Application* application = FindApplication(extension); | 170 Application* application = FindApplication(extension); |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 (*old_cursor)->name() == (*new_cursor)->name() && | 302 (*old_cursor)->name() == (*new_cursor)->name() && |
300 (*old_cursor)->id() == (*new_cursor)->id()) { | 303 (*old_cursor)->id() == (*new_cursor)->id()) { |
301 ++old_cursor; | 304 ++old_cursor; |
302 ++new_cursor; | 305 ++new_cursor; |
303 } | 306 } |
304 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { | 307 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { |
305 extensions_ = extensions; | 308 extensions_ = extensions; |
306 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged()); | 309 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged()); |
307 } | 310 } |
308 } | 311 } |
OLD | NEW |