Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(160)

Side by Side Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2029423003: OOPIF IME: Renderer Side Changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing kenrb@'s comments Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 2786 matching lines...) Expand 10 before | Expand all | Expand 10 after
2797 { 2797 {
2798 if (!mainFrameImpl()) 2798 if (!mainFrameImpl())
2799 return; 2799 return;
2800 Document* document = mainFrameImpl()->frame()->document(); 2800 Document* document = mainFrameImpl()->frame()->document();
2801 if (hasBlurryContent) 2801 if (hasBlurryContent)
2802 UseCounter::count(document, UseCounter::FixedRasterScaleBlurryContent); 2802 UseCounter::count(document, UseCounter::FixedRasterScaleBlurryContent);
2803 if (hasPotentialPerformanceRegression) 2803 if (hasPotentialPerformanceRegression)
2804 UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerform anceRegression); 2804 UseCounter::count(document, UseCounter::FixedRasterScalePotentialPerform anceRegression);
2805 } 2805 }
2806 2806
2807 bool WebViewImpl::getCompositionCharacterBounds(WebVector<WebRect>& bounds)
2808 {
2809 size_t offset = 0;
2810 size_t characterCount = 0;
2811 if (!compositionRange(&offset, &characterCount))
2812 return false;
2813
2814 if (characterCount == 0)
2815 return false;
2816
2817 WebLocalFrame* frame = focusedFrame()->toWebLocalFrame();
2818
2819 if (frame->localRoot() != mainFrameImpl())
kenrb 2016/06/28 20:55:57 A brief comment explaining this check would be use
EhsanK 2016/06/29 14:04:19 Acknowledged.
2820 return false;
2821
2822 if (!frame)
2823 return false;
2824
2825 WebVector<WebRect> result(characterCount);
2826 WebRect webrect;
2827 for (size_t i = 0; i < characterCount; ++i) {
2828 if (!frame->firstRectForCharacterRange(offset + i, 1, webrect)) {
2829 DLOG(ERROR) << "Could not retrieve character rectangle at " << i;
2830 return false;
2831 }
2832 result[i] = webrect;
2833 }
2834 bounds.swap(result);
2835 return true;
2836 }
2837
2838 void WebViewImpl::adjustReplacementRangeForAccentedCharacters(int start, int len gth)
2839 {
2840 if (WebLocalFrame* frame = focusedFrame()->toWebLocalFrame()) {
2841 WebRange webrange = WebRange::fromDocumentRange(frame, start, length);
2842 if (!webrange.isNull())
2843 frame->selectRange(webrange);
2844 }
2845 }
2846
2807 // WebView -------------------------------------------------------------------- 2847 // WebView --------------------------------------------------------------------
2808 2848
2809 WebSettingsImpl* WebViewImpl::settingsImpl() 2849 WebSettingsImpl* WebViewImpl::settingsImpl()
2810 { 2850 {
2811 if (!m_webSettings) 2851 if (!m_webSettings)
2812 m_webSettings = adoptPtr(new WebSettingsImpl(&m_page->settings(), m_devT oolsEmulator.get())); 2852 m_webSettings = adoptPtr(new WebSettingsImpl(&m_page->settings(), m_devT oolsEmulator.get()));
2813 DCHECK(m_webSettings); 2853 DCHECK(m_webSettings);
2814 return m_webSettings.get(); 2854 return m_webSettings.get();
2815 } 2855 }
2816 2856
(...skipping 1736 matching lines...) Expand 10 before | Expand all | Expand 10 after
4553 { 4593 {
4554 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than 4594 // TODO(oshima): Investigate if this should return the ScreenInfo's scale fa ctor rather than
4555 // page's scale factor, which can be 1 in use-zoom-for-dsf mode. 4595 // page's scale factor, which can be 1 in use-zoom-for-dsf mode.
4556 if (!page()) 4596 if (!page())
4557 return 1; 4597 return 1;
4558 4598
4559 return page()->deviceScaleFactor(); 4599 return page()->deviceScaleFactor();
4560 } 4600 }
4561 4601
4562 } // namespace blink 4602 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698