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

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

Issue 781743002: Deleted unused code about WebViewImpl::getSelectionRootBounds (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 m_client->scheduleAnimation(); 911 m_client->scheduleAnimation();
912 } 912 }
913 913
914 void WebViewImpl::setShowScrollBottleneckRects(bool show) 914 void WebViewImpl::setShowScrollBottleneckRects(bool show)
915 { 915 {
916 if (m_layerTreeView) 916 if (m_layerTreeView)
917 m_layerTreeView->setShowScrollBottleneckRects(show); 917 m_layerTreeView->setShowScrollBottleneckRects(show);
918 m_showScrollBottleneckRects = show; 918 m_showScrollBottleneckRects = show;
919 } 919 }
920 920
921 void WebViewImpl::getSelectionRootBounds(WebRect& bounds) const
922 {
923 const Frame* frame = focusedCoreFrame();
924 if (!frame || !frame->isLocalFrame())
925 return;
926
927 Element* root = toLocalFrame(frame)->selection().rootEditableElementOrDocume ntElement();
928 if (!root)
929 return;
930
931 // If the selection is inside a form control, the root will be a <div> that
932 // behaves as the editor but we want to return the actual element's bounds.
933 // In practice, that means <textarea> and <input> controls that behave like
934 // a text field.
935 Element* shadowHost = root->shadowHost();
936 if (shadowHost
937 && (isHTMLTextAreaElement(*shadowHost)
938 || (isHTMLInputElement(*shadowHost) && toHTMLInputElement(*shadowHos t).isTextField())))
939 root = shadowHost;
940
941 IntRect boundingBox = isHTMLHtmlElement(root)
942 ? IntRect(IntPoint(0, 0), root->document().frame()->view()->contentsSize ())
943 : root->pixelSnappedBoundingBox();
944
945 boundingBox = root->document().frame()->view()->contentsToWindow(boundingBox );
946 boundingBox.scale(pageScaleFactor());
947 bounds = boundingBox;
948 }
949
950 void WebViewImpl::acceptLanguagesChanged() 921 void WebViewImpl::acceptLanguagesChanged()
951 { 922 {
952 if (!page()) 923 if (!page())
953 return; 924 return;
954 925
955 page()->acceptLanguagesChanged(); 926 page()->acceptLanguagesChanged();
956 } 927 }
957 928
958 bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event) 929 bool WebViewImpl::handleKeyEvent(const WebKeyboardEvent& event)
959 { 930 {
(...skipping 3585 matching lines...) Expand 10 before | Expand all | Expand 10 after
4545 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4516 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4546 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4517 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4547 } 4518 }
4548 4519
4549 void WebViewImpl::forceNextWebGLContextCreationToFail() 4520 void WebViewImpl::forceNextWebGLContextCreationToFail()
4550 { 4521 {
4551 WebGLRenderingContext::forceNextWebGLContextCreationToFail(); 4522 WebGLRenderingContext::forceNextWebGLContextCreationToFail();
4552 } 4523 }
4553 4524
4554 } // namespace blink 4525 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698