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

Side by Side Diff: third_party/WebKit/Source/modules/notifications/Notification.cpp

Issue 1855443002: Implement receiving side of web notification inline replies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test and removed unnecessary code. Created 4 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 295
296 return m_developerData; 296 return m_developerData;
297 } 297 }
298 298
299 HeapVector<NotificationAction> Notification::actions() const 299 HeapVector<NotificationAction> Notification::actions() const
300 { 300 {
301 HeapVector<NotificationAction> actions; 301 HeapVector<NotificationAction> actions;
302 actions.grow(m_data.actions.size()); 302 actions.grow(m_data.actions.size());
303 303
304 for (size_t i = 0; i < m_data.actions.size(); ++i) { 304 for (size_t i = 0; i < m_data.actions.size(); ++i) {
305 switch (m_data.actions[i].type) {
306 case WebNotificationAction::Button:
307 actions[i].setType("button");
308 break;
309 case WebNotificationAction::Text:
310 actions[i].setType("text");
311 break;
312 default:
313 NOTREACHED() << "Unknown action type: " << m_data.actions[i].type;
314 }
305 actions[i].setAction(m_data.actions[i].action); 315 actions[i].setAction(m_data.actions[i].action);
306 actions[i].setTitle(m_data.actions[i].title); 316 actions[i].setTitle(m_data.actions[i].title);
307 actions[i].setIcon(m_data.actions[i].icon.string()); 317 actions[i].setIcon(m_data.actions[i].icon.string());
318 actions[i].setPlaceholder(m_data.actions[i].placeholder);
308 } 319 }
309 320
310 return actions; 321 return actions;
311 } 322 }
312 323
313 String Notification::permissionString(WebNotificationPermission permission) 324 String Notification::permissionString(WebNotificationPermission permission)
314 { 325 {
315 switch (permission) { 326 switch (permission) {
316 case WebNotificationPermissionAllowed: 327 case WebNotificationPermissionAllowed:
317 return "granted"; 328 return "granted";
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 } 395 }
385 396
386 DEFINE_TRACE(Notification) 397 DEFINE_TRACE(Notification)
387 { 398 {
388 visitor->trace(m_asyncRunner); 399 visitor->trace(m_asyncRunner);
389 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis itor); 400 RefCountedGarbageCollectedEventTargetWithInlineData<Notification>::trace(vis itor);
390 ActiveDOMObject::trace(visitor); 401 ActiveDOMObject::trace(visitor);
391 } 402 }
392 403
393 } // namespace blink 404 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698