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

Side by Side Diff: content/renderer/service_worker/service_worker_script_context.h

Issue 728763003: Introduce a //content/ API for dispatching notificationclick events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ 5 #ifndef CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ 6 #define CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 17 matching lines...) Expand all
28 class WebServiceWorkerContextProxy; 28 class WebServiceWorkerContextProxy;
29 } 29 }
30 30
31 namespace IPC { 31 namespace IPC {
32 class Message; 32 class Message;
33 } 33 }
34 34
35 namespace content { 35 namespace content {
36 36
37 class EmbeddedWorkerContextClient; 37 class EmbeddedWorkerContextClient;
38 struct ShowDesktopNotificationHostMsgParams;
38 39
39 // TODO(kinuko): This should implement WebServiceWorkerContextClient 40 // TODO(kinuko): This should implement WebServiceWorkerContextClient
40 // rather than having EmbeddedWorkerContextClient implement it. 41 // rather than having EmbeddedWorkerContextClient implement it.
41 // See the header comment in embedded_worker_context_client.h for the 42 // See the header comment in embedded_worker_context_client.h for the
42 // potential EW/SW layering concerns. 43 // potential EW/SW layering concerns.
43 class ServiceWorkerScriptContext { 44 class ServiceWorkerScriptContext {
44 public: 45 public:
45 ServiceWorkerScriptContext( 46 ServiceWorkerScriptContext(
46 EmbeddedWorkerContextClient* embedded_context, 47 EmbeddedWorkerContextClient* embedded_context,
47 blink::WebServiceWorkerContextProxy* proxy); 48 blink::WebServiceWorkerContextProxy* proxy);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 private: 86 private:
86 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer> 87 typedef IDMap<blink::WebServiceWorkerClientsCallbacks, IDMapOwnPointer>
87 ClientsCallbacksMap; 88 ClientsCallbacksMap;
88 typedef IDMap<blink::WebServiceWorkerClientFocusCallback, IDMapOwnPointer> 89 typedef IDMap<blink::WebServiceWorkerClientFocusCallback, IDMapOwnPointer>
89 FocusClientCallbacksMap; 90 FocusClientCallbacksMap;
90 91
91 void OnActivateEvent(int request_id); 92 void OnActivateEvent(int request_id);
92 void OnInstallEvent(int request_id, int active_version_id); 93 void OnInstallEvent(int request_id, int active_version_id);
93 void OnFetchEvent(int request_id, const ServiceWorkerFetchRequest& request); 94 void OnFetchEvent(int request_id, const ServiceWorkerFetchRequest& request);
94 void OnSyncEvent(int request_id); 95 void OnSyncEvent(int request_id);
95 void OnNotificationClickEvent(int request_id, 96 void OnNotificationClickEvent(
96 const std::string& notification_id); 97 int request_id,
98 const std::string& notification_id,
99 const ShowDesktopNotificationHostMsgParams& notification_data);
97 void OnPushEvent(int request_id, const std::string& data); 100 void OnPushEvent(int request_id, const std::string& data);
98 void OnGeofencingEvent(int request_id, 101 void OnGeofencingEvent(int request_id,
99 blink::WebGeofencingEventType event_type, 102 blink::WebGeofencingEventType event_type,
100 const std::string& region_id, 103 const std::string& region_id,
101 const blink::WebCircularGeofencingRegion& region); 104 const blink::WebCircularGeofencingRegion& region);
102 void OnPostMessage(const base::string16& message, 105 void OnPostMessage(const base::string16& message,
103 const std::vector<int>& sent_message_port_ids, 106 const std::vector<int>& sent_message_port_ids,
104 const std::vector<int>& new_routing_ids); 107 const std::vector<int>& new_routing_ids);
105 void OnDidGetClientDocuments( 108 void OnDidGetClientDocuments(
106 int request_id, const std::vector<int>& client_ids); 109 int request_id, const std::vector<int>& client_ids);
(...skipping 24 matching lines...) Expand all
131 std::map<int, base::TimeTicks> install_start_timings_; 134 std::map<int, base::TimeTicks> install_start_timings_;
132 std::map<int, base::TimeTicks> notification_click_start_timings_; 135 std::map<int, base::TimeTicks> notification_click_start_timings_;
133 std::map<int, base::TimeTicks> push_start_timings_; 136 std::map<int, base::TimeTicks> push_start_timings_;
134 137
135 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext); 138 DISALLOW_COPY_AND_ASSIGN(ServiceWorkerScriptContext);
136 }; 139 };
137 140
138 } // namespace content 141 } // namespace content
139 142
140 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_ 143 #endif // CONTENT_RENDERER_SERVICE_WORKER_SERVICE_WORKER_SCRIPT_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698