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/notifications/sync_notifier/synced_notification.h" | 5 #include "chrome/browser/notifications/sync_notifier/synced_notification.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // did, or because the URLs are empty. If so, we can display the notification. | 204 // did, or because the URLs are empty. If so, we can display the notification. |
205 | 205 |
206 // See if all bitmaps are accounted for, if so call Show(). | 206 // See if all bitmaps are accounted for, if so call Show(). |
207 if (AreAllBitmapsFetched()) { | 207 if (AreAllBitmapsFetched()) { |
208 Show(notification_manager_, notifier_service_, profile_); | 208 Show(notification_manager_, notifier_service_, profile_); |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 void SyncedNotification::StartBitmapFetch() { | 212 void SyncedNotification::StartBitmapFetch() { |
213 // Now that we have queued and counted them all, start the fetching. | 213 // Now that we have queued and counted them all, start the fetching. |
214 ScopedVector<NotificationBitmapFetcher>::iterator iter; | 214 ScopedVector<chrome::BitmapFetcher>::iterator iter; |
215 for (iter = fetchers_.begin(); iter != fetchers_.end(); ++iter) { | 215 for (iter = fetchers_.begin(); iter != fetchers_.end(); ++iter) { |
216 (*iter)->Start(profile_); | 216 (*iter)->Start(profile_); |
217 } | 217 } |
218 } | 218 } |
219 | 219 |
220 void SyncedNotification::AddBitmapToFetchQueue(const GURL& url) { | 220 void SyncedNotification::AddBitmapToFetchQueue(const GURL& url) { |
221 // Check for dups, ignore any request for a dup. | 221 // Check for dups, ignore any request for a dup. |
222 ScopedVector<NotificationBitmapFetcher>::iterator iter; | 222 ScopedVector<chrome::BitmapFetcher>::iterator iter; |
223 for (iter = fetchers_.begin(); iter != fetchers_.end(); ++iter) { | 223 for (iter = fetchers_.begin(); iter != fetchers_.end(); ++iter) { |
224 if ((*iter)->url() == url) | 224 if ((*iter)->url() == url) |
225 return; | 225 return; |
226 } | 226 } |
227 | 227 |
228 if (url.is_valid()) { | 228 if (url.is_valid()) { |
229 fetchers_.push_back(new NotificationBitmapFetcher(url, this)); | 229 fetchers_.push_back(new chrome::BitmapFetcher(url, this)); |
230 DVLOG(2) << __FUNCTION__ << "Pushing bitmap " << url; | 230 DVLOG(2) << __FUNCTION__ << "Pushing bitmap " << url; |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 void SyncedNotification::Show(NotificationUIManager* notification_manager, | 234 void SyncedNotification::Show(NotificationUIManager* notification_manager, |
235 ChromeNotifierService* notifier_service, | 235 ChromeNotifierService* notifier_service, |
236 Profile* profile) { | 236 Profile* profile) { |
237 // Let NotificationUIManager know that the notification has been dismissed. | 237 // Let NotificationUIManager know that the notification has been dismissed. |
238 if (SyncedNotification::kRead == GetReadState() || | 238 if (SyncedNotification::kRead == GetReadState() || |
239 SyncedNotification::kDismissed == GetReadState() ) { | 239 SyncedNotification::kDismissed == GetReadState() ) { |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
756 | 756 |
757 const gfx::Image& SyncedNotification::GetAppIcon() const { | 757 const gfx::Image& SyncedNotification::GetAppIcon() const { |
758 return app_icon_bitmap_; | 758 return app_icon_bitmap_; |
759 } | 759 } |
760 | 760 |
761 void SyncedNotification::SetToastState(bool toast_state) { | 761 void SyncedNotification::SetToastState(bool toast_state) { |
762 toast_state_ = toast_state; | 762 toast_state_ = toast_state; |
763 } | 763 } |
764 | 764 |
765 } // namespace notifier | 765 } // namespace notifier |
OLD | NEW |