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

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

Issue 319643002: Fixed touch selection handle manipulation when pinched in. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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
« no previous file with comments | « no previous file | Source/web/tests/PinchViewportTest.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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 #include "core/editing/FrameSelection.h" 93 #include "core/editing/FrameSelection.h"
94 #include "core/editing/InputMethodController.h" 94 #include "core/editing/InputMethodController.h"
95 #include "core/editing/PlainTextRange.h" 95 #include "core/editing/PlainTextRange.h"
96 #include "core/editing/SpellChecker.h" 96 #include "core/editing/SpellChecker.h"
97 #include "core/editing/TextAffinity.h" 97 #include "core/editing/TextAffinity.h"
98 #include "core/editing/TextIterator.h" 98 #include "core/editing/TextIterator.h"
99 #include "core/editing/htmlediting.h" 99 #include "core/editing/htmlediting.h"
100 #include "core/editing/markup.h" 100 #include "core/editing/markup.h"
101 #include "core/frame/Console.h" 101 #include "core/frame/Console.h"
102 #include "core/frame/DOMWindow.h" 102 #include "core/frame/DOMWindow.h"
103 #include "core/frame/FrameHost.h"
103 #include "core/frame/FrameView.h" 104 #include "core/frame/FrameView.h"
104 #include "core/frame/Settings.h" 105 #include "core/frame/Settings.h"
105 #include "core/html/HTMLCollection.h" 106 #include "core/html/HTMLCollection.h"
106 #include "core/html/HTMLFormElement.h" 107 #include "core/html/HTMLFormElement.h"
107 #include "core/html/HTMLFrameElementBase.h" 108 #include "core/html/HTMLFrameElementBase.h"
108 #include "core/html/HTMLFrameOwnerElement.h" 109 #include "core/html/HTMLFrameOwnerElement.h"
109 #include "core/html/HTMLHeadElement.h" 110 #include "core/html/HTMLHeadElement.h"
110 #include "core/html/HTMLInputElement.h" 111 #include "core/html/HTMLInputElement.h"
111 #include "core/html/HTMLLinkElement.h" 112 #include "core/html/HTMLLinkElement.h"
112 #include "core/html/PluginDocument.h" 113 #include "core/html/PluginDocument.h"
(...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1299 frame()->document()->head()->appendChild(styleElement.release(), IGNORE_EXCE PTION); 1300 frame()->document()->head()->appendChild(styleElement.release(), IGNORE_EXCE PTION);
1300 } 1301 }
1301 1302
1302 void WebLocalFrameImpl::setCaretVisible(bool visible) 1303 void WebLocalFrameImpl::setCaretVisible(bool visible)
1303 { 1304 {
1304 frame()->selection().setCaretVisible(visible); 1305 frame()->selection().setCaretVisible(visible);
1305 } 1306 }
1306 1307
1307 VisiblePosition WebLocalFrameImpl::visiblePositionForWindowPoint(const WebPoint& point) 1308 VisiblePosition WebLocalFrameImpl::visiblePositionForWindowPoint(const WebPoint& point)
1308 { 1309 {
1310 // FIXME(bokan): crbug.com/371902 - These scale/pinch transforms shouldn't
1311 // be ad hoc and explicit.
1312 PinchViewport& pinchViewport = frame()->page()->frameHost().pinchViewport();
1309 FloatPoint unscaledPoint(point); 1313 FloatPoint unscaledPoint(point);
1310 unscaledPoint.scale(1 / view()->pageScaleFactor(), 1 / view()->pageScaleFact or()); 1314 unscaledPoint.scale(1 / view()->pageScaleFactor(), 1 / view()->pageScaleFact or());
1315 unscaledPoint.moveBy(pinchViewport.visibleRect().location());
1311 1316
1312 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H itTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::Confusi ngAndOftenMisusedDisallowShadowContent; 1317 HitTestRequest request = HitTestRequest::Move | HitTestRequest::ReadOnly | H itTestRequest::Active | HitTestRequest::IgnoreClipping | HitTestRequest::Confusi ngAndOftenMisusedDisallowShadowContent;
1313 HitTestResult result(frame()->view()->windowToContents(roundedIntPoint(unsca ledPoint))); 1318 HitTestResult result(frame()->view()->windowToContents(roundedIntPoint(unsca ledPoint)));
1314 frame()->document()->renderView()->layer()->hitTest(request, result); 1319 frame()->document()->renderView()->layer()->hitTest(request, result);
1315 1320
1316 if (Node* node = result.targetNode()) 1321 if (Node* node = result.targetNode())
1317 return frame()->selection().selection().visiblePositionRespectingEditing Boundary(result.localPoint(), node); 1322 return frame()->selection().selection().visiblePositionRespectingEditing Boundary(result.localPoint(), node);
1318 return VisiblePosition(); 1323 return VisiblePosition();
1319 } 1324 }
1320 1325
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
1915 1920
1916 void WebLocalFrameImpl::invalidateAll() const 1921 void WebLocalFrameImpl::invalidateAll() const
1917 { 1922 {
1918 ASSERT(frame() && frame()->view()); 1923 ASSERT(frame() && frame()->view());
1919 FrameView* view = frame()->view(); 1924 FrameView* view = frame()->view();
1920 view->invalidateRect(view->frameRect()); 1925 view->invalidateRect(view->frameRect());
1921 invalidateScrollbar(); 1926 invalidateScrollbar();
1922 } 1927 }
1923 1928
1924 } // namespace blink 1929 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | Source/web/tests/PinchViewportTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698