| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 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 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2531 page()->willCloseLayerTreeView(*m_layerTreeView, nullptr); | 2531 page()->willCloseLayerTreeView(*m_layerTreeView, nullptr); |
| 2532 | 2532 |
| 2533 setRootLayer(nullptr); | 2533 setRootLayer(nullptr); |
| 2534 m_animationHost = nullptr; | 2534 m_animationHost = nullptr; |
| 2535 | 2535 |
| 2536 m_mutator = nullptr; | 2536 m_mutator = nullptr; |
| 2537 m_layerTreeView = nullptr; | 2537 m_layerTreeView = nullptr; |
| 2538 } | 2538 } |
| 2539 | 2539 |
| 2540 void WebViewImpl::didAcquirePointerLock() { | 2540 void WebViewImpl::didAcquirePointerLock() { |
| 2541 mainFrameImpl()->frameWidget()->didAcquirePointerLock(); | 2541 if (mainFrameImpl()) |
| 2542 mainFrameImpl()->frameWidget()->didAcquirePointerLock(); |
| 2542 } | 2543 } |
| 2543 | 2544 |
| 2544 void WebViewImpl::didNotAcquirePointerLock() { | 2545 void WebViewImpl::didNotAcquirePointerLock() { |
| 2545 mainFrameImpl()->frameWidget()->didNotAcquirePointerLock(); | 2546 if (mainFrameImpl()) |
| 2547 mainFrameImpl()->frameWidget()->didNotAcquirePointerLock(); |
| 2546 } | 2548 } |
| 2547 | 2549 |
| 2548 void WebViewImpl::didLosePointerLock() { | 2550 void WebViewImpl::didLosePointerLock() { |
| 2549 mainFrameImpl()->frameWidget()->didLosePointerLock(); | 2551 // Make sure that the main frame wasn't swapped-out when the pointer lock is |
| 2552 // lost. There's a race that can happen when a pointer lock is requested, but |
| 2553 // the browser swaps out the main frame while the pointer lock request is in |
| 2554 // progress. This won't be needed once the main frame is refactored to not use |
| 2555 // the WebViewImpl as its WebWidget. |
| 2556 if (mainFrameImpl()) |
| 2557 mainFrameImpl()->frameWidget()->didLosePointerLock(); |
| 2550 } | 2558 } |
| 2551 | 2559 |
| 2552 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as | 2560 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as |
| 2553 // well. This code needs to be refactored (http://crbug.com/629721). | 2561 // well. This code needs to be refactored (http://crbug.com/629721). |
| 2554 bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) { | 2562 bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) { |
| 2555 WebRange range = compositionRange(); | 2563 WebRange range = compositionRange(); |
| 2556 if (range.isEmpty()) | 2564 if (range.isEmpty()) |
| 2557 return false; | 2565 return false; |
| 2558 | 2566 |
| 2559 WebLocalFrame* frame = focusedFrame(); | 2567 WebLocalFrame* frame = focusedFrame(); |
| (...skipping 1606 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4166 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) | 4174 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) |
| 4167 return nullptr; | 4175 return nullptr; |
| 4168 return focusedFrame; | 4176 return focusedFrame; |
| 4169 } | 4177 } |
| 4170 | 4178 |
| 4171 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { | 4179 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { |
| 4172 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; | 4180 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; |
| 4173 } | 4181 } |
| 4174 | 4182 |
| 4175 } // namespace blink | 4183 } // namespace blink |
| OLD | NEW |