| 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 19 matching lines...) Expand all  Loading... | 
| 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 = base::Callback<void(ServiceWorkerClients* clients)>; | 
| 34 | 34 | 
| 35 // Focuses the window client associated with |provider_host|. |callback| is | 35 // Focuses the window client associated with |provider_host|. |callback| is | 
| 36 // called with the client information on completion. | 36 // called with the client information on completion. | 
| 37 void FocusWindowClient(ServiceWorkerProviderHost* provider_host, | 37 void FocusWindowClient(ServiceWorkerProviderHost* provider_host, | 
| 38                        const ClientCallback& callback); | 38                        const ClientCallback& callback); | 
| 39 | 39 | 
| 40 // Opens a new window and navigates it to |url|. |callback| is called with the | 40 // Opens a new window and navigates it to |url|. |redirect_url| is the last | 
| 41 // window's client information on completion. | 41 // navigation occured before |url|. |callback| is called with the window's | 
| 42 void OpenWindow(const GURL& url, | 42 // client information on completion. | 
|  | 43 void OpenWindow(const GURL& redirect_url, | 
|  | 44                 const GURL& url, | 
| 43                 const GURL& script_url, | 45                 const GURL& script_url, | 
| 44                 int worker_process_id, | 46                 int worker_process_id, | 
| 45                 const base::WeakPtr<ServiceWorkerContextCore>& context, | 47                 const base::WeakPtr<ServiceWorkerContextCore>& context, | 
| 46                 const NavigationCallback& callback); | 48                 const NavigationCallback& callback); | 
| 47 | 49 | 
| 48 // Navigates the client specified by |process_id| and |frame_id| to |url|. | 50 // Navigates the client specified by |process_id| and |frame_id| to |url|. | 
| 49 // |callback| is called with the client information on completion. | 51 // |callback| is called with the client information on completion. | 
| 50 void NavigateClient(const GURL& url, | 52 void NavigateClient(const GURL& url, | 
| 51                     const GURL& script_url, | 53                     const GURL& script_url, | 
| 52                     int process_id, | 54                     int process_id, | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 63 // information sorted in MRU order (most recently focused order) on completion. | 65 // information sorted in MRU order (most recently focused order) on completion. | 
| 64 void GetClients(const base::WeakPtr<ServiceWorkerVersion>& controller, | 66 void GetClients(const base::WeakPtr<ServiceWorkerVersion>& controller, | 
| 65                 const ServiceWorkerClientQueryOptions& options, | 67                 const ServiceWorkerClientQueryOptions& options, | 
| 66                 const ClientsCallback& callback); | 68                 const ClientsCallback& callback); | 
| 67 | 69 | 
| 68 }  // namespace service_worker_client_utils | 70 }  // namespace service_worker_client_utils | 
| 69 | 71 | 
| 70 }  // namespace content | 72 }  // namespace content | 
| 71 | 73 | 
| 72 #endif  // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ | 74 #endif  // CONTENT_BROWSER_SERVICE_WORKER_SERVICE_WORKER_CLIENT_UTILS_H_ | 
| OLD | NEW | 
|---|