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

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

Issue 2199523002: Convert WebRange to be a simple pair of numbers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot the exports. Created 4 years, 4 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 2833 matching lines...) Expand 10 before | Expand all | Expand 10 after
2844 return false; 2844 return false;
2845 } 2845 }
2846 result[i] = webrect; 2846 result[i] = webrect;
2847 } 2847 }
2848 bounds.swap(result); 2848 bounds.swap(result);
2849 return true; 2849 return true;
2850 } 2850 }
2851 2851
2852 void WebViewImpl::applyReplacementRange(int start, int length) 2852 void WebViewImpl::applyReplacementRange(int start, int length)
2853 { 2853 {
2854 if (WebLocalFrame* frame = focusedFrame()) { 2854 if (WebLocalFrame* frame = focusedFrame())
2855 WebRange webrange = WebRange::fromDocumentRange(frame, start, length); 2855 frame->selectRange(WebRange(start, length));
2856 if (!webrange.isNull())
2857 frame->selectRange(webrange);
2858 }
2859 } 2856 }
2860 2857
2861 // WebView -------------------------------------------------------------------- 2858 // WebView --------------------------------------------------------------------
2862 2859
2863 WebSettingsImpl* WebViewImpl::settingsImpl() 2860 WebSettingsImpl* WebViewImpl::settingsImpl()
2864 { 2861 {
2865 if (!m_webSettings) 2862 if (!m_webSettings)
2866 m_webSettings = wrapUnique(new WebSettingsImpl(&m_page->settings(), m_de vToolsEmulator.get())); 2863 m_webSettings = wrapUnique(new WebSettingsImpl(&m_page->settings(), m_de vToolsEmulator.get()));
2867 DCHECK(m_webSettings); 2864 DCHECK(m_webSettings);
2868 return m_webSettings.get(); 2865 return m_webSettings.get();
(...skipping 1749 matching lines...) Expand 10 before | Expand all | Expand 10 after
4618 return nullptr; 4615 return nullptr;
4619 return focusedFrame; 4616 return focusedFrame;
4620 } 4617 }
4621 4618
4622 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const 4619 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const
4623 { 4620 {
4624 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4621 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4625 } 4622 }
4626 4623
4627 } // namespace blink 4624 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebSurroundingText.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698