Chromium Code Reviews| 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 2806 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2817 if (page()) | 2817 if (page()) |
| 2818 page()->pointerLockController().didLosePointerLock(); | 2818 page()->pointerLockController().didLosePointerLock(); |
| 2819 } | 2819 } |
| 2820 | 2820 |
| 2821 void WebViewImpl::didChangeWindowResizerRect() | 2821 void WebViewImpl::didChangeWindowResizerRect() |
| 2822 { | 2822 { |
| 2823 if (mainFrameImpl()->frameView()) | 2823 if (mainFrameImpl()->frameView()) |
| 2824 mainFrameImpl()->frameView()->windowResizerRectChanged(); | 2824 mainFrameImpl()->frameView()->windowResizerRectChanged(); |
| 2825 } | 2825 } |
| 2826 | 2826 |
| 2827 bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) | |
| 2828 { | |
| 2829 size_t offset = 0; | |
| 2830 size_t characterCount = 0; | |
| 2831 if (!compositionRange(&offset, &characterCount)) | |
| 2832 return false; | |
| 2833 | |
| 2834 if (characterCount == 0) | |
| 2835 return false; | |
| 2836 | |
| 2837 WebLocalFrame* frame = focusedFrame()->toWebLocalFrame(); | |
| 2838 | |
| 2839 // Only consider frames whose local root is the main frame. For other | |
| 2840 // local frames which have different local roots, the corresponding | |
| 2841 // WebFrameWidget will handle this task. | |
| 2842 if (frame->localRoot() != mainFrameImpl()) | |
|
lfg
2016/07/05 18:30:46
Why is this needed?
EhsanK
2016/07/07 14:40:47
I need to make sure that only WebFrameWidgetImpl s
lfg
2016/07/07 15:13:31
See my comment in WebFrameWidgetImpl.cpp.
EhsanK
2016/07/07 20:25:07
Acknowledged.
| |
| 2843 return false; | |
| 2844 | |
| 2845 if (!frame) | |
|
lfg
2016/07/05 18:30:46
This would've crashed in the if statement before.
EhsanK
2016/07/07 14:40:47
Thanks! Acknowledged.
| |
| 2846 return false; | |
| 2847 | |
| 2848 WebVector<WebRect> result(characterCount); | |
| 2849 WebRect webrect; | |
| 2850 for (size_t i = 0; i < characterCount; ++i) { | |
| 2851 if (!frame->firstRectForCharacterRange(offset + i, 1, webrect)) { | |
| 2852 DLOG(ERROR) << "Could not retrieve character rectangle at " << i; | |
| 2853 return false; | |
| 2854 } | |
| 2855 result[i] = webrect; | |
| 2856 } | |
| 2857 bounds.swap(result); | |
| 2858 return true; | |
| 2859 } | |
| 2860 | |
| 2861 void WebViewImpl::applyReplacementRange(int start, int length) | |
| 2862 { | |
| 2863 if (WebLocalFrame* frame = focusedFrame()->toWebLocalFrame()) { | |
| 2864 WebRange webrange = WebRange::fromDocumentRange(frame, start, length); | |
| 2865 if (!webrange.isNull()) | |
| 2866 frame->selectRange(webrange); | |
| 2867 } | |
| 2868 } | |
| 2869 | |
| 2827 // WebView -------------------------------------------------------------------- | 2870 // WebView -------------------------------------------------------------------- |
| 2828 | 2871 |
| 2829 WebSettingsImpl* WebViewImpl::settingsImpl() | 2872 WebSettingsImpl* WebViewImpl::settingsImpl() |
| 2830 { | 2873 { |
| 2831 if (!m_webSettings) | 2874 if (!m_webSettings) |
| 2832 m_webSettings = wrapUnique(new WebSettingsImpl(&m_page->settings(), m_de vToolsEmulator.get())); | 2875 m_webSettings = wrapUnique(new WebSettingsImpl(&m_page->settings(), m_de vToolsEmulator.get())); |
| 2833 DCHECK(m_webSettings); | 2876 DCHECK(m_webSettings); |
| 2834 return m_webSettings.get(); | 2877 return m_webSettings.get(); |
| 2835 } | 2878 } |
| 2836 | 2879 |
| (...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4523 { | 4566 { |
| 4524 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than | 4567 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than |
| 4525 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4568 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4526 if (!page()) | 4569 if (!page()) |
| 4527 return 1; | 4570 return 1; |
| 4528 | 4571 |
| 4529 return page()->deviceScaleFactor(); | 4572 return page()->deviceScaleFactor(); |
| 4530 } | 4573 } |
| 4531 | 4574 |
| 4532 } // namespace blink | 4575 } // namespace blink |
| OLD | NEW |