OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 return EventTargetNames::ServiceWorkerContainer; | 284 return EventTargetNames::ServiceWorkerContainer; |
285 } | 285 } |
286 | 286 |
287 bool ServiceWorkerContainer::getClientInfo(WebServiceWorkerClientInfo* info) | 287 bool ServiceWorkerContainer::getClientInfo(WebServiceWorkerClientInfo* info) |
288 { | 288 { |
289 ExecutionContext* context = executionContext(); | 289 ExecutionContext* context = executionContext(); |
290 // FIXME: Make this work for non-document context (e.g. shared workers). | 290 // FIXME: Make this work for non-document context (e.g. shared workers). |
291 if (!context || !context->isDocument()) | 291 if (!context || !context->isDocument()) |
292 return false; | 292 return false; |
293 Document* document = toDocument(context); | 293 Document* document = toDocument(context); |
294 // FIXME: remove info->visibilityState when Chromium is updated. | |
295 info->visibilityState = document->visibilityState(); | |
296 info->pageVisibilityState = static_cast<WebPageVisibilityState>(document->pa
geVisibilityState()); | 294 info->pageVisibilityState = static_cast<WebPageVisibilityState>(document->pa
geVisibilityState()); |
297 info->isFocused = document->hasFocus(); | 295 info->isFocused = document->hasFocus(); |
298 info->url = document->url(); | 296 info->url = document->url(); |
299 if (!document->frame()) | 297 if (!document->frame()) |
300 info->frameType = WebURLRequest::FrameTypeNone; | 298 info->frameType = WebURLRequest::FrameTypeNone; |
301 else if (document->frame()->isMainFrame()) | 299 else if (document->frame()->isMainFrame()) |
302 info->frameType = WebURLRequest::FrameTypeTopLevel; | 300 info->frameType = WebURLRequest::FrameTypeTopLevel; |
303 else | 301 else |
304 info->frameType = WebURLRequest::FrameTypeNested; | 302 info->frameType = WebURLRequest::FrameTypeNested; |
305 return true; | 303 return true; |
(...skipping 10 matching lines...) Expand all Loading... |
316 m_ready = createReadyProperty(); | 314 m_ready = createReadyProperty(); |
317 | 315 |
318 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { | 316 if (ServiceWorkerContainerClient* client = ServiceWorkerContainerClient::fro
m(executionContext)) { |
319 m_provider = client->provider(); | 317 m_provider = client->provider(); |
320 if (m_provider) | 318 if (m_provider) |
321 m_provider->setClient(this); | 319 m_provider->setClient(this); |
322 } | 320 } |
323 } | 321 } |
324 | 322 |
325 } // namespace blink | 323 } // namespace blink |
OLD | NEW |