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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 extension_misc::ExtensionIcons size) { | 140 extension_misc::ExtensionIcons size) { |
141 extensions::ExtensionResource resource = | 141 extensions::ExtensionResource resource = |
142 extensions::IconsInfo::GetIconResource( | 142 extensions::IconsInfo::GetIconResource( |
143 extension_, size, ExtensionIconSet::MATCH_BIGGER); | 143 extension_, size, ExtensionIconSet::MATCH_BIGGER); |
144 extensions::ImageLoader::Get(model_->profile_)->LoadImageAsync( | 144 extensions::ImageLoader::Get(model_->profile_)->LoadImageAsync( |
145 extension_, resource, gfx::Size(size, size), | 145 extension_, resource, gfx::Size(size, size), |
146 base::Bind(&Application::OnImageLoaded, AsWeakPtr())); | 146 base::Bind(&Application::OnImageLoaded, AsWeakPtr())); |
147 } | 147 } |
148 | 148 |
149 BackgroundApplicationListModel::~BackgroundApplicationListModel() { | 149 BackgroundApplicationListModel::~BackgroundApplicationListModel() { |
150 STLDeleteContainerPairSecondPointers(applications_.begin(), | 150 base::STLDeleteContainerPairSecondPointers(applications_.begin(), |
151 applications_.end()); | 151 applications_.end()); |
152 } | 152 } |
153 | 153 |
154 BackgroundApplicationListModel::BackgroundApplicationListModel(Profile* profile) | 154 BackgroundApplicationListModel::BackgroundApplicationListModel(Profile* profile) |
155 : profile_(profile), | 155 : profile_(profile), |
156 ready_(false) { | 156 ready_(false) { |
157 DCHECK(profile_); | 157 DCHECK(profile_); |
158 registrar_.Add(this, | 158 registrar_.Add(this, |
159 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 159 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
160 content::Source<Profile>(profile)); | 160 content::Source<Profile>(profile)); |
161 registrar_.Add(this, | 161 registrar_.Add(this, |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 (*old_cursor)->name() == (*new_cursor)->name() && | 398 (*old_cursor)->name() == (*new_cursor)->name() && |
399 (*old_cursor)->id() == (*new_cursor)->id()) { | 399 (*old_cursor)->id() == (*new_cursor)->id()) { |
400 ++old_cursor; | 400 ++old_cursor; |
401 ++new_cursor; | 401 ++new_cursor; |
402 } | 402 } |
403 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { | 403 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { |
404 extensions_ = extensions; | 404 extensions_ = extensions; |
405 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); | 405 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); |
406 } | 406 } |
407 } | 407 } |
OLD | NEW |