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

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

Issue 1054573002: Implement support for notification.vibrate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/platform_notification_service_impl.h" 5 #include "chrome/browser/notifications/platform_notification_service_impl.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/notifications/desktop_notification_profile_util.h" 10 #include "chrome/browser/notifications/desktop_notification_profile_util.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 286
287 // TODO(peter): Icons for Web Notifications are currently always requested for 287 // TODO(peter): Icons for Web Notifications are currently always requested for
288 // 1x scale, whereas the displays on which they can be displayed can have a 288 // 1x scale, whereas the displays on which they can be displayed can have a
289 // different pixel density. Be smarter about this when the API gets updated 289 // different pixel density. Be smarter about this when the API gets updated
290 // with a way for developers to specify images of different resolutions. 290 // with a way for developers to specify images of different resolutions.
291 Notification notification(origin, notification_data.title, 291 Notification notification(origin, notification_data.title,
292 notification_data.body, gfx::Image::CreateFrom1xBitmap(icon), 292 notification_data.body, gfx::Image::CreateFrom1xBitmap(icon),
293 display_source, notification_data.tag, delegate); 293 display_source, notification_data.tag, delegate);
294 294
295 notification.set_context_message(display_source); 295 notification.set_context_message(display_source);
296 notification.set_vibrate(notification_data.vibrate);
296 notification.set_silent(notification_data.silent); 297 notification.set_silent(notification_data.silent);
297 298
298 // Web Notifications do not timeout. 299 // Web Notifications do not timeout.
299 notification.set_never_timeout(true); 300 notification.set_never_timeout(true);
300 301
301 return notification; 302 return notification;
302 } 303 }
303 304
304 NotificationUIManager* 305 NotificationUIManager*
305 PlatformNotificationServiceImpl::GetNotificationUIManager() const { 306 PlatformNotificationServiceImpl::GetNotificationUIManager() const {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 formatted_origin.push_back(':'); 355 formatted_origin.push_back(':');
355 formatted_origin.append(base::UTF8ToUTF16(origin.port())); 356 formatted_origin.append(base::UTF8ToUTF16(origin.port()));
356 } 357 }
357 return formatted_origin; 358 return formatted_origin;
358 } 359 }
359 360
360 // TODO(dewittj): Once file:// URLs are passed in to the origin 361 // TODO(dewittj): Once file:// URLs are passed in to the origin
361 // GURL here, begin returning the path as the display name. 362 // GURL here, begin returning the path as the display name.
362 return net::FormatUrl(origin, languages); 363 return net::FormatUrl(origin, languages);
363 } 364 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698