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

Side by Side Diff: content/shell/renderer/test_runner/notification_presenter.h

Issue 740543003: Remove the old Web Notification code-path (Chromium) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove unittest references Created 6 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_NOTIFICATION_PRESENTER_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_NOTIFICATION_PRESENTER_H_
7
8 #include <map>
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "third_party/WebKit/public/web/WebNotification.h"
13 #include "third_party/WebKit/public/web/WebNotificationPresenter.h"
14
15 namespace content {
16
17 class WebTestDelegate;
18
19 // A class that implements WebNotificationPresenter for the TestRunner library.
20 class NotificationPresenter : public blink::WebNotificationPresenter {
21 public:
22 NotificationPresenter();
23 virtual ~NotificationPresenter();
24
25 // Called by the TestRunner to simulate a user clicking on a notification.
26 bool SimulateClick(const std::string& title);
27
28 // Called by the TestRunner to reset the presenter to an default state.
29 void Reset();
30
31 void set_delegate(WebTestDelegate* delegate) { delegate_ = delegate; }
32
33 // blink::WebNotificationPresenter interface
34 virtual bool show(const blink::WebNotification& notification);
35 virtual void cancel(const blink::WebNotification& notification);
36 virtual void objectDestroyed(const blink::WebNotification& notification);
37 virtual Permission checkPermission(
38 const blink::WebSecurityOrigin& security_origin);
39
40 private:
41 WebTestDelegate* delegate_;
42
43 // Map of currently active notifications.
44 typedef std::map<std::string, blink::WebNotification> ActiveNotificationMap;
45 ActiveNotificationMap active_notifications_;
46
47 // Map of replacement identifiers to the titles of those notifications.
48 std::map<std::string, std::string> replacements_;
49
50 DISALLOW_COPY_AND_ASSIGN(NotificationPresenter);
51 };
52
53 } // namespace content
54
55 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_NOTIFICATION_PRESENTER_H_
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/webkit_test_runner.cc ('k') | content/shell/renderer/test_runner/notification_presenter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698