Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: chrome/browser/notifications/message_center_notification_manager.cc

Issue 554213003: Request the icon of a Web Notification in the renderer process. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removes now redundant code Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/message_center_notification_manager.h" 5 #include "chrome/browser/notifications/message_center_notification_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/prefs/pref_registry_simple.h" 9 #include "base/prefs/pref_registry_simple.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 335 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 observer_(observer) { 346 observer_(observer) {
347 } 347 }
348 348
349 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { } 349 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { }
350 350
351 void MessageCenterNotificationManager::ImageDownloads::StartDownloads( 351 void MessageCenterNotificationManager::ImageDownloads::StartDownloads(
352 const Notification& notification) { 352 const Notification& notification) {
353 // In case all downloads are synchronous, assume a pending download. 353 // In case all downloads are synchronous, assume a pending download.
354 AddPendingDownload(); 354 AddPendingDownload();
355 355
356 // Notification primary icon.
357 StartDownloadWithImage(
358 notification,
359 &notification.icon(),
360 notification.icon_url(),
361 base::Bind(&message_center::MessageCenter::SetNotificationIcon,
362 base::Unretained(message_center_),
363 notification.delegate_id()));
364
365 // Notification image. 356 // Notification image.
366 StartDownloadWithImage( 357 StartDownloadWithImage(
367 notification, 358 notification,
368 NULL, 359 NULL,
369 notification.image_url(), 360 notification.image_url(),
370 base::Bind(&message_center::MessageCenter::SetNotificationImage, 361 base::Bind(&message_center::MessageCenter::SetNotificationImage,
371 base::Unretained(message_center_), 362 base::Unretained(message_center_),
372 notification.delegate_id())); 363 notification.delegate_id()));
373 364
374 // Notification button icons. 365 // Notification button icons.
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 it != registry->enabled_extensions().end(); 554 it != registry->enabled_extensions().end();
564 ++it) { 555 ++it) {
565 if ((*it->get()).permissions_data()->HasAPIPermission( 556 if ((*it->get()).permissions_data()->HasAPIPermission(
566 extensions::APIPermission::ID::kNotificationProvider)) { 557 extensions::APIPermission::ID::kNotificationProvider)) {
567 extension_id = (*it->get()).id(); 558 extension_id = (*it->get()).id();
568 return extension_id; 559 return extension_id;
569 } 560 }
570 } 561 }
571 return extension_id; 562 return extension_id;
572 } 563 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698