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 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 | 132 |
133 BackgroundApplicationListModel::Observer::~Observer() { | 133 BackgroundApplicationListModel::Observer::~Observer() { |
134 } | 134 } |
135 | 135 |
136 BackgroundApplicationListModel::Application::~Application() { | 136 BackgroundApplicationListModel::Application::~Application() { |
137 } | 137 } |
138 | 138 |
139 BackgroundApplicationListModel::Application::Application( | 139 BackgroundApplicationListModel::Application::Application( |
140 BackgroundApplicationListModel* model, | 140 BackgroundApplicationListModel* model, |
141 const Extension* extension) | 141 const Extension* extension) |
142 : extension_(extension), | 142 : extension_(extension), model_(model) {} |
143 icon_(NULL), | |
144 model_(model) { | |
145 } | |
146 | 143 |
147 void BackgroundApplicationListModel::Application::OnImageLoaded( | 144 void BackgroundApplicationListModel::Application::OnImageLoaded( |
148 const gfx::Image& image) { | 145 const gfx::Image& image) { |
149 if (image.IsEmpty()) | 146 if (image.IsEmpty()) |
150 return; | 147 return; |
151 icon_.reset(image.CopyImageSkia()); | 148 icon_.reset(image.CopyImageSkia()); |
152 model_->SendApplicationDataChangedNotifications(extension_); | 149 model_->SendApplicationDataChangedNotifications(extension_); |
153 } | 150 } |
154 | 151 |
155 void BackgroundApplicationListModel::Application::RequestIcon( | 152 void BackgroundApplicationListModel::Application::RequestIcon( |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 (*old_cursor)->name() == (*new_cursor)->name() && | 408 (*old_cursor)->name() == (*new_cursor)->name() && |
412 (*old_cursor)->id() == (*new_cursor)->id()) { | 409 (*old_cursor)->id() == (*new_cursor)->id()) { |
413 ++old_cursor; | 410 ++old_cursor; |
414 ++new_cursor; | 411 ++new_cursor; |
415 } | 412 } |
416 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { | 413 if (old_cursor != extensions_.end() || new_cursor != extensions.end()) { |
417 extensions_ = extensions; | 414 extensions_ = extensions; |
418 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); | 415 FOR_EACH_OBSERVER(Observer, observers_, OnApplicationListChanged(profile_)); |
419 } | 416 } |
420 } | 417 } |
OLD | NEW |