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

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

Issue 580243004: Remove unnecessary image downloading handler of notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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/desktop_notification_service.h" 5 #include "chrome/browser/notifications/desktop_notification_service.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/scoped_user_pref_update.h" 9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 callback)); 151 callback));
152 } 152 }
153 153
154 void DesktopNotificationService::ShowDesktopNotification( 154 void DesktopNotificationService::ShowDesktopNotification(
155 const content::ShowDesktopNotificationHostMsgParams& params, 155 const content::ShowDesktopNotificationHostMsgParams& params,
156 content::RenderFrameHost* render_frame_host, 156 content::RenderFrameHost* render_frame_host,
157 scoped_ptr<content::DesktopNotificationDelegate> delegate, 157 scoped_ptr<content::DesktopNotificationDelegate> delegate,
158 base::Closure* cancel_callback) { 158 base::Closure* cancel_callback) {
159 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 159 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
160 const GURL& origin = params.origin; 160 const GURL& origin = params.origin;
161 NotificationObjectProxy* proxy = 161 NotificationObjectProxy* proxy =new NotificationObjectProxy(delegate.Pass());
oshima 2014/09/21 15:26:01 nit: space after =
Jun Mukai 2014/09/22 18:54:37 Done.
162 new NotificationObjectProxy(render_frame_host, delegate.Pass());
163 162
164 base::string16 display_source = DisplayNameForOriginInProcessId( 163 base::string16 display_source = DisplayNameForOriginInProcessId(
165 origin, render_frame_host->GetProcess()->GetID()); 164 origin, render_frame_host->GetProcess()->GetID());
166 165
167 // TODO(peter): gfx::Image only provides an API to convert a SkBitmap to an 166 // TODO(peter): gfx::Image only provides an API to convert a SkBitmap to an
168 // image using 1x scale. While the Views system will resize is for the 167 // image using 1x scale. While the Views system will resize is for the
169 // appropriate resolution, doing so immediately should result in icons of 168 // appropriate resolution, doing so immediately should result in icons of
170 // higher quality. 169 // higher quality.
171 Notification notification(message_center::NOTIFICATION_TYPE_SIMPLE, 170 Notification notification(message_center::NOTIFICATION_TYPE_SIMPLE,
172 origin, 171 origin,
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // Tell the IO thread that this extension's permission for notifications 353 // Tell the IO thread that this extension's permission for notifications
355 // has changed. 354 // has changed.
356 extensions::InfoMap* extension_info_map = 355 extensions::InfoMap* extension_info_map =
357 extensions::ExtensionSystem::Get(profile_)->info_map(); 356 extensions::ExtensionSystem::Get(profile_)->info_map();
358 BrowserThread::PostTask( 357 BrowserThread::PostTask(
359 BrowserThread::IO, FROM_HERE, 358 BrowserThread::IO, FROM_HERE,
360 base::Bind(&extensions::InfoMap::SetNotificationsDisabled, 359 base::Bind(&extensions::InfoMap::SetNotificationsDisabled,
361 extension_info_map, notifier_id.id, !enabled)); 360 extension_info_map, notifier_id.id, !enabled));
362 #endif 361 #endif
363 } 362 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698