OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_NAVIGATION_UTILS_H_ | |
6 #define CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_NAVIGATION_UTILS_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/callback.h" | |
11 #include "base/memory/weak_ptr.h" | |
12 #include "content/common/service_worker/service_worker_status_code.h" | |
13 | |
14 class GURL; | |
15 | |
16 namespace content { | |
17 | |
18 class ServiceWorkerContextCore; | |
19 struct ServiceWorkerClientInfo; | |
20 | |
21 namespace service_worker_client_navigation_utils { | |
22 | |
23 using NavigationCallback = | |
24 base::Callback<void(ServiceWorkerStatusCode status, | |
25 const std::string& client_uuid, | |
26 const ServiceWorkerClientInfo& client_info)>; | |
27 | |
28 // Opens a new window and navigates it to |url|. |callback| is called with the | |
29 // window's client information on completion. | |
30 void OpenWindow(const GURL& url, | |
31 const GURL& script_url, | |
32 int worker_process_id, | |
33 const base::WeakPtr<ServiceWorkerContextCore>& context, | |
34 const NavigationCallback& callback); | |
35 | |
36 // Navigates the client specified by |process_id| and |frame_id| to |url|. | |
37 // |callback| is called with the client information on completion. | |
38 void NavigateClient(const GURL& url, | |
39 const GURL& script_url, | |
40 int process_id, | |
41 int frame_id, | |
42 const base::WeakPtr<ServiceWorkerContextCore>& context, | |
43 const NavigationCallback& callback); | |
44 | |
45 } // namespace service_worker_client_navigation_utils | |
46 | |
47 } // namespace content | |
48 | |
49 #endif // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_NAVIGATION_UTILS
_H_ | |
OLD | NEW |