OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 PagePopupSupplement::Install(*frame, *this, popup_client_); | 325 PagePopupSupplement::Install(*frame, *this, popup_client_); |
326 DCHECK_EQ(popup_client_->OwnerElement().GetDocument().ExistingAXObjectCache(), | 326 DCHECK_EQ(popup_client_->OwnerElement().GetDocument().ExistingAXObjectCache(), |
327 frame->GetDocument()->ExistingAXObjectCache()); | 327 frame->GetDocument()->ExistingAXObjectCache()); |
328 | 328 |
329 InitializeLayerTreeView(); | 329 InitializeLayerTreeView(); |
330 | 330 |
331 RefPtr<SharedBuffer> data = SharedBuffer::Create(); | 331 RefPtr<SharedBuffer> data = SharedBuffer::Create(); |
332 popup_client_->WriteDocument(data.Get()); | 332 popup_client_->WriteDocument(data.Get()); |
333 frame->SetPageZoomFactor(popup_client_->ZoomFactor()); | 333 frame->SetPageZoomFactor(popup_client_->ZoomFactor()); |
334 frame->Loader().Load( | 334 frame->Loader().Load( |
335 FrameLoadRequest(0, BlankURL(), | 335 FrameLoadRequest(0, ResourceRequest(BlankURL()), |
336 SubstituteData(data, "text/html", "UTF-8", KURL(), | 336 SubstituteData(data, "text/html", "UTF-8", KURL(), |
337 kForceSynchronousLoad))); | 337 kForceSynchronousLoad))); |
338 return true; | 338 return true; |
339 } | 339 } |
340 | 340 |
341 void WebPagePopupImpl::PostMessage(const String& message) { | 341 void WebPagePopupImpl::PostMessage(const String& message) { |
342 if (!page_) | 342 if (!page_) |
343 return; | 343 return; |
344 ScriptForbiddenScope::AllowUserAgentScript allow_script; | 344 ScriptForbiddenScope::AllowUserAgentScript allow_script; |
345 if (LocalDOMWindow* window = ToLocalFrame(page_->MainFrame())->DomWindow()) | 345 if (LocalDOMWindow* window = ToLocalFrame(page_->MainFrame())->DomWindow()) |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 // A WebPagePopupImpl instance usually has two references. | 602 // A WebPagePopupImpl instance usually has two references. |
603 // - One owned by the instance itself. It represents the visible widget. | 603 // - One owned by the instance itself. It represents the visible widget. |
604 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the | 604 // - One owned by a WebViewImpl. It's released when the WebViewImpl ask the |
605 // WebPagePopupImpl to close. | 605 // WebPagePopupImpl to close. |
606 // We need them because the closing operation is asynchronous and the widget | 606 // We need them because the closing operation is asynchronous and the widget |
607 // can be closed while the WebViewImpl is unaware of it. | 607 // can be closed while the WebViewImpl is unaware of it. |
608 return AdoptRef(new WebPagePopupImpl(client)).LeakRef(); | 608 return AdoptRef(new WebPagePopupImpl(client)).LeakRef(); |
609 } | 609 } |
610 | 610 |
611 } // namespace blink | 611 } // namespace blink |
OLD | NEW |