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

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, 7 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 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 316
317 // TODO(peter): Icons for Web Notifications are currently always requested for 317 // TODO(peter): Icons for Web Notifications are currently always requested for
318 // 1x scale, whereas the displays on which they can be displayed can have a 318 // 1x scale, whereas the displays on which they can be displayed can have a
319 // different pixel density. Be smarter about this when the API gets updated 319 // different pixel density. Be smarter about this when the API gets updated
320 // with a way for developers to specify images of different resolutions. 320 // with a way for developers to specify images of different resolutions.
321 Notification notification(origin, notification_data.title, 321 Notification notification(origin, notification_data.title,
322 notification_data.body, gfx::Image::CreateFrom1xBitmap(icon), 322 notification_data.body, gfx::Image::CreateFrom1xBitmap(icon),
323 display_source, notification_data.tag, delegate); 323 display_source, notification_data.tag, delegate);
324 324
325 notification.set_context_message(display_source); 325 notification.set_context_message(display_source);
326 notification.set_vibration_pattern(notification_data.vibration_pattern);
326 notification.set_silent(notification_data.silent); 327 notification.set_silent(notification_data.silent);
327 328
328 // Web Notifications do not timeout. 329 // Web Notifications do not timeout.
329 notification.set_never_timeout(true); 330 notification.set_never_timeout(true);
330 331
331 return notification; 332 return notification;
332 } 333 }
333 334
334 NotificationUIManager* 335 NotificationUIManager*
335 PlatformNotificationServiceImpl::GetNotificationUIManager() const { 336 PlatformNotificationServiceImpl::GetNotificationUIManager() const {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 formatted_origin.push_back(':'); 385 formatted_origin.push_back(':');
385 formatted_origin.append(base::UTF8ToUTF16(origin.port())); 386 formatted_origin.append(base::UTF8ToUTF16(origin.port()));
386 } 387 }
387 return formatted_origin; 388 return formatted_origin;
388 } 389 }
389 390
390 // TODO(dewittj): Once file:// URLs are passed in to the origin 391 // TODO(dewittj): Once file:// URLs are passed in to the origin
391 // GURL here, begin returning the path as the display name. 392 // GURL here, begin returning the path as the display name.
392 return net::FormatUrl(origin, languages); 393 return net::FormatUrl(origin, languages);
393 } 394 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698