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

Side by Side Diff: chrome/renderer/resources/extensions/notifications_custom_bindings.js

Issue 308053004: Add appIconMask to notification API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments Created 6 years, 5 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 // Custom bindings for the notifications API. 5 // Custom bindings for the notifications API.
6 // 6 //
7 var binding = require('binding').Binding.create('notifications'); 7 var binding = require('binding').Binding.create('notifications');
8 8
9 var sendRequest = require('sendRequest').sendRequest; 9 var sendRequest = require('sendRequest').sendRequest;
10 var imageUtil = require('imageUtil'); 10 var imageUtil = require('imageUtil');
(...skipping 22 matching lines...) Expand all
33 // |iconUrl| might be optional for notification updates. 33 // |iconUrl| might be optional for notification updates.
34 if (notificationDetails.iconUrl) { 34 if (notificationDetails.iconUrl) {
35 $Array.push(urlSpecs, { 35 $Array.push(urlSpecs, {
36 path: notificationDetails.iconUrl, 36 path: notificationDetails.iconUrl,
37 width: imageSizes.icon.width * imageSizes.scaleFactor, 37 width: imageSizes.icon.width * imageSizes.scaleFactor,
38 height: imageSizes.icon.height * imageSizes.scaleFactor, 38 height: imageSizes.icon.height * imageSizes.scaleFactor,
39 callback: imageDataSetter(notificationDetails, 'iconBitmap') 39 callback: imageDataSetter(notificationDetails, 'iconBitmap')
40 }); 40 });
41 } 41 }
42 42
43 // |appIconMaskUrl| is optional.
44 if (notificationDetails.appIconMaskUrl) {
45 $Array.push(urlSpecs, {
46 path: notificationDetails.appIconMaskUrl,
47 width: imageSizes.appIconMask.width * imageSizes.scaleFactor,
48 height: imageSizes.appIconMask.height * imageSizes.scaleFactor,
49 callback: imageDataSetter(notificationDetails, 'appIconMaskBitmap')
50 });
51 }
52
43 // |imageUrl| is optional. 53 // |imageUrl| is optional.
44 if (notificationDetails.imageUrl) { 54 if (notificationDetails.imageUrl) {
45 $Array.push(urlSpecs, { 55 $Array.push(urlSpecs, {
46 path: notificationDetails.imageUrl, 56 path: notificationDetails.imageUrl,
47 width: imageSizes.image.width * imageSizes.scaleFactor, 57 width: imageSizes.image.width * imageSizes.scaleFactor,
48 height: imageSizes.image.height * imageSizes.scaleFactor, 58 height: imageSizes.image.height * imageSizes.scaleFactor,
49 callback: imageDataSetter(notificationDetails, 'imageBitmap') 59 callback: imageDataSetter(notificationDetails, 'imageBitmap')
50 }); 60 });
51 } 61 }
52 62
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 136
127 var notificationsCustomHook = function(bindingsAPI, extensionId) { 137 var notificationsCustomHook = function(bindingsAPI, extensionId) {
128 var apiFunctions = bindingsAPI.apiFunctions; 138 var apiFunctions = bindingsAPI.apiFunctions;
129 apiFunctions.setHandleRequest('create', handleCreate); 139 apiFunctions.setHandleRequest('create', handleCreate);
130 apiFunctions.setHandleRequest('update', handleUpdate); 140 apiFunctions.setHandleRequest('update', handleUpdate);
131 }; 141 };
132 142
133 binding.registerCustomHook(notificationsCustomHook); 143 binding.registerCustomHook(notificationsCustomHook);
134 144
135 exports.binding = binding.generate(); 145 exports.binding = binding.generate();
OLDNEW
« no previous file with comments | « chrome/renderer/extensions/notifications_native_handler.cc ('k') | ui/message_center/message_center_style.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698