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

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

Issue 102473005: Refresh for the Chrome notifications image template. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac unit test Created 7 years 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 var binding = require('binding').Binding.create('notifications'); 6 var binding = require('binding').Binding.create('notifications');
7 7
8 var sendRequest = require('sendRequest').sendRequest; 8 var sendRequest = require('sendRequest').sendRequest;
9 var imageUtil = require('imageUtil'); 9 var imageUtil = require('imageUtil');
10 var lastError = require('lastError'); 10 var lastError = require('lastError');
(...skipping 24 matching lines...) Expand all
35 height: 80, 35 height: 80,
36 callback: image_data_setter(notification_details, 'iconBitmap') 36 callback: image_data_setter(notification_details, 'iconBitmap')
37 }); 37 });
38 } 38 }
39 39
40 // |imageUrl| is optional. 40 // |imageUrl| is optional.
41 if (notification_details.imageUrl) { 41 if (notification_details.imageUrl) {
42 $Array.push(url_specs, { 42 $Array.push(url_specs, {
43 path: notification_details.imageUrl, 43 path: notification_details.imageUrl,
44 width: 360, 44 width: 360,
45 height: 540, 45 height: 240,
46 callback: image_data_setter(notification_details, 'imageBitmap') 46 callback: image_data_setter(notification_details, 'imageBitmap')
47 }); 47 });
48 } 48 }
49 49
50 // Each button has an optional icon. 50 // Each button has an optional icon.
51 var button_list = notification_details.buttons; 51 var button_list = notification_details.buttons;
52 if (button_list && typeof button_list.length === 'number') { 52 if (button_list && typeof button_list.length === 'number') {
53 var num_buttons = button_list.length; 53 var num_buttons = button_list.length;
54 for (var i = 0; i < num_buttons; i++) { 54 for (var i = 0; i < num_buttons; i++) {
55 if (button_list[i].iconUrl) { 55 if (button_list[i].iconUrl) {
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 var notificationsCustomHook = function(bindingsAPI, extensionId) { 118 var notificationsCustomHook = function(bindingsAPI, extensionId) {
119 var apiFunctions = bindingsAPI.apiFunctions; 119 var apiFunctions = bindingsAPI.apiFunctions;
120 apiFunctions.setHandleRequest('create', handleCreate); 120 apiFunctions.setHandleRequest('create', handleCreate);
121 apiFunctions.setHandleRequest('update', handleUpdate); 121 apiFunctions.setHandleRequest('update', handleUpdate);
122 }; 122 };
123 123
124 binding.registerCustomHook(notificationsCustomHook); 124 binding.registerCustomHook(notificationsCustomHook);
125 125
126 exports.binding = binding.generate(); 126 exports.binding = binding.generate();
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/notifications/notifications_api.cc ('k') | ui/message_center/cocoa/notification_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698