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 2838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2849 { | 2849 { |
| 2850 if (!mainFrameImpl()) | 2850 if (!mainFrameImpl()) |
| 2851 return; | 2851 return; |
| 2852 Document* document = mainFrameImpl()->frame()->document(); | 2852 Document* document = mainFrameImpl()->frame()->document(); |
| 2853 if (hasBlurryContent) | 2853 if (hasBlurryContent) |
| 2854 UseCounter::count(document, UseCounter::FixedRasterScaleBlurryContent); | 2854 UseCounter::count(document, UseCounter::FixedRasterScaleBlurryContent); |
| 2855 if (hasPotentialPerformanceRegression) | 2855 if (hasPotentialPerformanceRegression) |
| 2856 UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerform anceRegression); | 2856 UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerform anceRegression); |
| 2857 } | 2857 } |
| 2858 | 2858 |
| 2859 bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds) | |
|
EhsanK
2016/06/03 02:38:54
This is basically RenderViewImpl::GetCompositionCh
kenrb
2016/06/07 20:18:13
Seems fine, to me.
| |
| 2860 { | |
| 2861 size_t offset = 0; | |
| 2862 size_t characterCount = 0; | |
| 2863 if (!compositionRange(&offset, &characterCount)) | |
| 2864 return false; | |
| 2865 | |
| 2866 if (characterCount == 0) | |
| 2867 return false; | |
| 2868 | |
| 2869 WebLocalFrame* frame = focusedFrame()->toWebLocalFrame(); | |
| 2870 if (!frame) | |
| 2871 return false; | |
| 2872 | |
| 2873 WebVector<WebRect> result(characterCount); | |
| 2874 WebRect webrect; | |
| 2875 for (size_t i = 0; i < characterCount; ++i) { | |
| 2876 if (!frame->firstRectForCharacterRange(offset + i, 1, webrect)) { | |
| 2877 DLOG(ERROR) << "Could not retrieve character rectangle at " << i; | |
| 2878 return false; | |
| 2879 } | |
| 2880 result[i] = webrect; | |
| 2881 } | |
| 2882 bounds.swap(result); | |
| 2883 return true; | |
| 2884 } | |
| 2885 | |
| 2859 // WebView -------------------------------------------------------------------- | 2886 // WebView -------------------------------------------------------------------- |
| 2860 | 2887 |
| 2861 WebSettingsImpl* WebViewImpl::settingsImpl() | 2888 WebSettingsImpl* WebViewImpl::settingsImpl() |
| 2862 { | 2889 { |
| 2863 if (!m_webSettings) | 2890 if (!m_webSettings) |
| 2864 m_webSettings = adoptPtr(new WebSettingsImpl(&m_page->settings(), m_devT oolsEmulator.get())); | 2891 m_webSettings = adoptPtr(new WebSettingsImpl(&m_page->settings(), m_devT oolsEmulator.get())); |
| 2865 DCHECK(m_webSettings); | 2892 DCHECK(m_webSettings); |
| 2866 return m_webSettings.get(); | 2893 return m_webSettings.get(); |
| 2867 } | 2894 } |
| 2868 | 2895 |
| (...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4605 { | 4632 { |
| 4606 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than | 4633 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than |
| 4607 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. | 4634 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. |
| 4608 if (!page()) | 4635 if (!page()) |
| 4609 return 1; | 4636 return 1; |
| 4610 | 4637 |
| 4611 return page()->deviceScaleFactor(); | 4638 return page()->deviceScaleFactor(); |
| 4612 } | 4639 } |
| 4613 | 4640 |
| 4614 } // namespace blink | 4641 } // namespace blink |
| OLD | NEW |