Chromium Code Reviews| Index: content/browser/service_worker/service_worker_version.cc |
| diff --git a/content/browser/service_worker/service_worker_version.cc b/content/browser/service_worker/service_worker_version.cc |
| index e72bc88a66c8fa4c0c0fc0428b0c684a9fb9bc43..3addc8499e33d8f24d5222c6eb80d2575435d69d 100644 |
| --- a/content/browser/service_worker/service_worker_version.cc |
| +++ b/content/browser/service_worker/service_worker_version.cc |
| @@ -926,8 +926,10 @@ bool ServiceWorkerVersion::OnMessageReceived(const IPC::Message& message) { |
| IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_GetClient, OnGetClient) |
| IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_GetClients, |
| OnGetClients) |
| - IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_OpenWindow, |
| - OnOpenWindow) |
| + IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_OpenWindowForClients, |
| + OnOpenWindowForClients) |
| + IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_OpenWindowForPaymentHandler, |
|
please use gerrit instead
2017/06/02 03:43:17
Excellent!
gogerald1
2017/06/02 13:21:40
Acknowledged.
|
| + OnOpenWindowForPaymentHandler) |
| IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_SetCachedMetadata, |
| OnSetCachedMetadata) |
| IPC_MESSAGE_HANDLER(ServiceWorkerHostMsg_ClearCachedMetadata, |
| @@ -1044,7 +1046,19 @@ void ServiceWorkerVersion::CountFeature(uint32_t feature) { |
| provider_host_by_uuid.second->CountFeature(feature); |
| } |
| -void ServiceWorkerVersion::OnOpenWindow(int request_id, GURL url) { |
| +void ServiceWorkerVersion::OnOpenWindowForClients(int request_id, GURL url) { |
| + OnOpenWindow(request_id, url, WindowOpenDisposition::NEW_FOREGROUND_TAB); |
| +} |
| + |
| +void ServiceWorkerVersion::OnOpenWindowForPaymentHandler(int request_id, |
| + GURL url) { |
| + // Open popup window for payment handler. |
| + OnOpenWindow(request_id, url, WindowOpenDisposition::NEW_POPUP); |
| +} |
| + |
| +void ServiceWorkerVersion::OnOpenWindow(int request_id, |
| + GURL url, |
| + WindowOpenDisposition disposition) { |
| // Just abort if we are shutting down. |
| if (!context_) |
| return; |
| @@ -1075,7 +1089,7 @@ void ServiceWorkerVersion::OnOpenWindow(int request_id, GURL url) { |
| } |
| service_worker_client_utils::OpenWindow( |
| - url, script_url_, embedded_worker_->process_id(), context_, |
| + url, script_url_, embedded_worker_->process_id(), context_, disposition, |
| base::Bind(&ServiceWorkerVersion::OnOpenWindowFinished, |
| weak_factory_.GetWeakPtr(), request_id)); |
| } |