| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * Copyright (C) 2013 Apple Inc. All rights reserved. | 3 * Copyright (C) 2013 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 if (!s_pagePopupDriver) | 662 if (!s_pagePopupDriver) |
| 663 s_pagePopupDriver = MockPagePopupDriver::create(page->deprecatedLocalMai
nFrame()).leakPtr(); | 663 s_pagePopupDriver = MockPagePopupDriver::create(page->deprecatedLocalMai
nFrame()).leakPtr(); |
| 664 page->chrome().client().setPagePopupDriver(s_pagePopupDriver); | 664 page->chrome().client().setPagePopupDriver(s_pagePopupDriver); |
| 665 } | 665 } |
| 666 | 666 |
| 667 PassRefPtrWillBeRawPtr<PagePopupController> Internals::pagePopupController() | 667 PassRefPtrWillBeRawPtr<PagePopupController> Internals::pagePopupController() |
| 668 { | 668 { |
| 669 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0; | 669 return s_pagePopupDriver ? s_pagePopupDriver->pagePopupController() : 0; |
| 670 } | 670 } |
| 671 | 671 |
| 672 LocalDOMWindow* Internals::pagePopupWindow() const |
| 673 { |
| 674 Document* document = contextDocument(); |
| 675 if (!document) |
| 676 return nullptr; |
| 677 Page* page = document->page(); |
| 678 if (!page) |
| 679 return nullptr; |
| 680 PagePopupDriver* pagePopupDriver = page->chrome().client().pagePopupDriver()
; |
| 681 if (!pagePopupDriver) |
| 682 return nullptr; |
| 683 return pagePopupDriver->pagePopupWindow(); |
| 684 } |
| 685 |
| 672 PassRefPtrWillBeRawPtr<ClientRect> Internals::absoluteCaretBounds(ExceptionState
& exceptionState) | 686 PassRefPtrWillBeRawPtr<ClientRect> Internals::absoluteCaretBounds(ExceptionState
& exceptionState) |
| 673 { | 687 { |
| 674 Document* document = contextDocument(); | 688 Document* document = contextDocument(); |
| 675 if (!document || !document->frame()) { | 689 if (!document || !document->frame()) { |
| 676 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc
ument's frame cannot be retrieved." : "No context document can be obtained."); | 690 exceptionState.throwDOMException(InvalidAccessError, document ? "The doc
ument's frame cannot be retrieved." : "No context document can be obtained."); |
| 677 return ClientRect::create(); | 691 return ClientRect::create(); |
| 678 } | 692 } |
| 679 | 693 |
| 680 return ClientRect::create(document->frame()->selection().absoluteCaretBounds
()); | 694 return ClientRect::create(document->frame()->selection().absoluteCaretBounds
()); |
| 681 } | 695 } |
| (...skipping 1543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2225 } | 2239 } |
| 2226 if (!element->isPluginElement()) { | 2240 if (!element->isPluginElement()) { |
| 2227 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not a plugin."); | 2241 exceptionState.throwDOMException(InvalidNodeTypeError, "The element prov
ided is not a plugin."); |
| 2228 return; | 2242 return; |
| 2229 } | 2243 } |
| 2230 element->ensureUserAgentShadowRoot().setInnerHTML(htmlSource, exceptionState
); | 2244 element->ensureUserAgentShadowRoot().setInnerHTML(htmlSource, exceptionState
); |
| 2231 toHTMLPlugInElement(element)->setUsePlaceholderContent(true); | 2245 toHTMLPlugInElement(element)->setUsePlaceholderContent(true); |
| 2232 } | 2246 } |
| 2233 | 2247 |
| 2234 } // namespace blink | 2248 } // namespace blink |
| OLD | NEW |