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

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

Issue 198683002: Make it possible to override the tickmarks for a WebFrame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 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 | « Source/web/WebFrameImpl.h ('k') | Source/web/tests/WebFrameTest.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 1917 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 distanceInBestFrame = distanceInFrame; 1928 distanceInBestFrame = distanceInFrame;
1929 } 1929 }
1930 } 1930 }
1931 1931
1932 if (indexInBestFrame != -1) 1932 if (indexInBestFrame != -1)
1933 return bestFrame->selectFindMatch(static_cast<unsigned>(indexInBestFrame ), selectionRect); 1933 return bestFrame->selectFindMatch(static_cast<unsigned>(indexInBestFrame ), selectionRect);
1934 1934
1935 return -1; 1935 return -1;
1936 } 1936 }
1937 1937
1938 void WebFrameImpl::setTickmarks(const WebVector<WebRect>& tickmarks)
1939 {
1940 if (frameView()) {
1941 Vector<IntRect> tickmarksConverted(tickmarks.size());
1942 for (size_t i = 0; i < tickmarks.size(); ++i)
1943 tickmarksConverted[i] = tickmarks[i];
1944 frameView()->setTickmarks(tickmarksConverted);
1945 invalidateArea(InvalidateScrollbar);
1946 }
1947 }
1948
1938 int WebFrameImpl::nearestFindMatch(const FloatPoint& point, float& distanceSquar ed) 1949 int WebFrameImpl::nearestFindMatch(const FloatPoint& point, float& distanceSquar ed)
1939 { 1950 {
1940 updateFindMatchRects(); 1951 updateFindMatchRects();
1941 1952
1942 int nearest = -1; 1953 int nearest = -1;
1943 distanceSquared = FLT_MAX; 1954 distanceSquared = FLT_MAX;
1944 for (size_t i = 0; i < m_findMatchesCache.size(); ++i) { 1955 for (size_t i = 0; i < m_findMatchesCache.size(); ++i) {
1945 ASSERT(!m_findMatchesCache[i].m_rect.isEmpty()); 1956 ASSERT(!m_findMatchesCache[i].m_rect.isEmpty());
1946 FloatSize offset = point - m_findMatchesCache[i].m_rect.center(); 1957 FloatSize offset = point - m_findMatchesCache[i].m_rect.center();
1947 float width = offset.width(); 1958 float width = offset.width();
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
2484 2495
2485 // There is a possibility that the frame being detached was the only 2496 // There is a possibility that the frame being detached was the only
2486 // pending one. We need to make sure final replies can be sent. 2497 // pending one. We need to make sure final replies can be sent.
2487 flushCurrentScopingEffort(m_findRequestIdentifier); 2498 flushCurrentScopingEffort(m_findRequestIdentifier);
2488 2499
2489 cancelPendingScopingEffort(); 2500 cancelPendingScopingEffort();
2490 } 2501 }
2491 } 2502 }
2492 2503
2493 } // namespace blink 2504 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/WebFrameImpl.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698