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

Side by Side Diff: Source/testing/runner/NotificationPresenter.h

Issue 22852029: Add testRunner.cancelAllActiveNotifications to close all active notifications. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rename Created 7 years, 4 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
« no previous file with comments | « no previous file | Source/testing/runner/NotificationPresenter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 virtual ~NotificationPresenter(); 48 virtual ~NotificationPresenter();
49 49
50 void setDelegate(WebTestDelegate* delegate) { m_delegate = delegate; } 50 void setDelegate(WebTestDelegate* delegate) { m_delegate = delegate; }
51 51
52 // Called by the TestRunner to simulate a user granting permission. 52 // Called by the TestRunner to simulate a user granting permission.
53 void grantPermission(const WebKit::WebString& origin); 53 void grantPermission(const WebKit::WebString& origin);
54 54
55 // Called by the TestRunner to simulate a user clicking on a notification. 55 // Called by the TestRunner to simulate a user clicking on a notification.
56 bool simulateClick(const WebKit::WebString& notificationIdentifier); 56 bool simulateClick(const WebKit::WebString& notificationIdentifier);
57 57
58 // Called by the TestRunner to cancel all active notications.
59 void cancelAllActiveNotifications();
60
58 // WebKit::WebNotificationPresenter interface 61 // WebKit::WebNotificationPresenter interface
59 virtual bool show(const WebKit::WebNotification&); 62 virtual bool show(const WebKit::WebNotification&);
60 virtual void cancel(const WebKit::WebNotification&); 63 virtual void cancel(const WebKit::WebNotification&);
61 virtual void objectDestroyed(const WebKit::WebNotification&); 64 virtual void objectDestroyed(const WebKit::WebNotification&);
62 virtual Permission checkPermission(const WebKit::WebSecurityOrigin&); 65 virtual Permission checkPermission(const WebKit::WebSecurityOrigin&);
63 virtual void requestPermission(const WebKit::WebSecurityOrigin&, WebKit::Web NotificationPermissionCallback*); 66 virtual void requestPermission(const WebKit::WebSecurityOrigin&, WebKit::Web NotificationPermissionCallback*);
64 67
65 void reset() { m_allowedOrigins.clear(); } 68 void reset() { m_allowedOrigins.clear(); }
66 69
67 private: 70 private:
68 WebTestDelegate* m_delegate; 71 WebTestDelegate* m_delegate;
69 72
70 // Set of allowed origins. 73 // Set of allowed origins.
71 std::set<std::string> m_allowedOrigins; 74 std::set<std::string> m_allowedOrigins;
72 75
73 // Map of active notifications. 76 // Map of active notifications.
74 std::map<std::string, WebKit::WebNotification> m_activeNotifications; 77 std::map<std::string, WebKit::WebNotification> m_activeNotifications;
75 78
76 // Map of active replacement IDs to the titles of those notifications 79 // Map of active replacement IDs to the titles of those notifications
77 std::map<std::string, std::string> m_replacements; 80 std::map<std::string, std::string> m_replacements;
78 }; 81 };
79 82
80 } 83 }
81 84
82 #endif // NotificationPresenter_h 85 #endif // NotificationPresenter_h
OLDNEW
« no previous file with comments | « no previous file | Source/testing/runner/NotificationPresenter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698