OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ | 5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ | 6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 struct ServiceWorkerClientQueryOptions; | 23 struct ServiceWorkerClientQueryOptions; |
24 | 24 |
25 namespace service_worker_client_utils { | 25 namespace service_worker_client_utils { |
26 | 26 |
27 using NavigationCallback = | 27 using NavigationCallback = |
28 base::Callback<void(ServiceWorkerStatusCode status, | 28 base::Callback<void(ServiceWorkerStatusCode status, |
29 const ServiceWorkerClientInfo& client_info)>; | 29 const ServiceWorkerClientInfo& client_info)>; |
30 using ClientCallback = | 30 using ClientCallback = |
31 base::Callback<void(const ServiceWorkerClientInfo& client_info)>; | 31 base::Callback<void(const ServiceWorkerClientInfo& client_info)>; |
32 using ServiceWorkerClients = std::vector<ServiceWorkerClientInfo>; | 32 using ServiceWorkerClients = std::vector<ServiceWorkerClientInfo>; |
33 using ClientsCallback = base::Callback<void(ServiceWorkerClients* clients)>; | 33 using ClientsCallback = |
| 34 base::Callback<void(std::unique_ptr<ServiceWorkerClients> clients)>; |
34 | 35 |
35 // Focuses the window client associated with |provider_host|. |callback| is | 36 // Focuses the window client associated with |provider_host|. |callback| is |
36 // called with the client information on completion. | 37 // called with the client information on completion. |
37 void FocusWindowClient(ServiceWorkerProviderHost* provider_host, | 38 void FocusWindowClient(ServiceWorkerProviderHost* provider_host, |
38 const ClientCallback& callback); | 39 const ClientCallback& callback); |
39 | 40 |
40 // Opens a new window and navigates it to |url|. |callback| is called with the | 41 // Opens a new window and navigates it to |url|. |callback| is called with the |
41 // window's client information on completion. | 42 // window's client information on completion. |
42 void OpenWindow(const GURL& url, | 43 void OpenWindow(const GURL& url, |
43 const GURL& script_url, | 44 const GURL& script_url, |
(...skipping 19 matching lines...) Expand all Loading... |
63 // information sorted in MRU order (most recently focused order) on completion. | 64 // information sorted in MRU order (most recently focused order) on completion. |
64 void GetClients(const base::WeakPtr<ServiceWorkerVersion>& controller, | 65 void GetClients(const base::WeakPtr<ServiceWorkerVersion>& controller, |
65 const ServiceWorkerClientQueryOptions& options, | 66 const ServiceWorkerClientQueryOptions& options, |
66 const ClientsCallback& callback); | 67 const ClientsCallback& callback); |
67 | 68 |
68 } // namespace service_worker_client_utils | 69 } // namespace service_worker_client_utils |
69 | 70 |
70 } // namespace content | 71 } // namespace content |
71 | 72 |
72 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ | 73 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ |
OLD | NEW |