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

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

Issue 2674253004: [refactor] Remove WebWidget::applyReplacementRange (Closed)
Patch Set: more refactoring Created 3 years, 10 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 2553 matching lines...) Expand 10 before | Expand all | Expand 10 after
2564 if (!frame->firstRectForCharacterRange(offset + i, 1, webrect)) { 2564 if (!frame->firstRectForCharacterRange(offset + i, 1, webrect)) {
2565 DLOG(ERROR) << "Could not retrieve character rectangle at " << i; 2565 DLOG(ERROR) << "Could not retrieve character rectangle at " << i;
2566 return false; 2566 return false;
2567 } 2567 }
2568 result[i] = webrect; 2568 result[i] = webrect;
2569 } 2569 }
2570 bounds.swap(result); 2570 bounds.swap(result);
2571 return true; 2571 return true;
2572 } 2572 }
2573 2573
2574 // TODO(ekaramad):This method is almost duplicated in WebFrameWidgetImpl as
2575 // well. This code needs to be refactored (http://crbug.com/629721).
2576 void WebViewImpl::applyReplacementRange(const WebRange& range) {
2577 if (WebLocalFrame* frame = focusedFrame())
2578 frame->selectRange(range);
2579 }
2580
2581 // WebView -------------------------------------------------------------------- 2574 // WebView --------------------------------------------------------------------
2582 2575
2583 WebSettingsImpl* WebViewImpl::settingsImpl() { 2576 WebSettingsImpl* WebViewImpl::settingsImpl() {
2584 if (!m_webSettings) 2577 if (!m_webSettings)
2585 m_webSettings = WTF::wrapUnique( 2578 m_webSettings = WTF::wrapUnique(
2586 new WebSettingsImpl(&m_page->settings(), m_devToolsEmulator.get())); 2579 new WebSettingsImpl(&m_page->settings(), m_devToolsEmulator.get()));
2587 DCHECK(m_webSettings); 2580 DCHECK(m_webSettings);
2588 return m_webSettings.get(); 2581 return m_webSettings.get();
2589 } 2582 }
2590 2583
(...skipping 1603 matching lines...) Expand 10 before | Expand all | Expand 10 after
4194 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame()) 4187 if (focusedFrame->localFrameRoot() != mainFrameImpl()->frame())
4195 return nullptr; 4188 return nullptr;
4196 return focusedFrame; 4189 return focusedFrame;
4197 } 4190 }
4198 4191
4199 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const { 4192 LocalFrame* WebViewImpl::focusedLocalFrameAvailableForIme() const {
4200 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr; 4193 return m_imeAcceptEvents ? focusedLocalFrameInWidget() : nullptr;
4201 } 4194 }
4202 4195
4203 } // namespace blink 4196 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698