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

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: include logging.h Created 6 years, 2 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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 observer_(observer) { 372 observer_(observer) {
373 } 373 }
374 374
375 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { } 375 MessageCenterNotificationManager::ImageDownloads::~ImageDownloads() { }
376 376
377 void MessageCenterNotificationManager::ImageDownloads::StartDownloads( 377 void MessageCenterNotificationManager::ImageDownloads::StartDownloads(
378 const Notification& notification) { 378 const Notification& notification) {
379 // In case all downloads are synchronous, assume a pending download. 379 // In case all downloads are synchronous, assume a pending download.
380 AddPendingDownload(); 380 AddPendingDownload();
381 381
382 // Notification primary icon.
383 StartDownloadWithImage(
384 notification,
385 &notification.icon(),
386 notification.icon_url(),
387 base::Bind(&message_center::MessageCenter::SetNotificationIcon,
388 base::Unretained(message_center_),
389 notification.id()));
390
391 // Notification image. 382 // Notification image.
392 StartDownloadWithImage( 383 StartDownloadWithImage(
393 notification, 384 notification,
394 NULL, 385 NULL,
395 notification.image_url(), 386 notification.image_url(),
396 base::Bind(&message_center::MessageCenter::SetNotificationImage, 387 base::Bind(&message_center::MessageCenter::SetNotificationImage,
397 base::Unretained(message_center_), 388 base::Unretained(message_center_),
398 notification.id())); 389 notification.id()));
399 390
400 // Notification button icons. 391 // Notification button icons.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 it != registry->enabled_extensions().end(); 563 it != registry->enabled_extensions().end();
573 ++it) { 564 ++it) {
574 if ((*it->get()).permissions_data()->HasAPIPermission( 565 if ((*it->get()).permissions_data()->HasAPIPermission(
575 extensions::APIPermission::ID::kNotificationProvider)) { 566 extensions::APIPermission::ID::kNotificationProvider)) {
576 extension_id = (*it->get()).id(); 567 extension_id = (*it->get()).id();
577 return extension_id; 568 return extension_id;
578 } 569 }
579 } 570 }
580 return extension_id; 571 return extension_id;
581 } 572 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698