Title: [175476] trunk/Source/WebKit2
Revision
175476
Author
[email protected]
Date
2014-11-03 11:17:20 -0800 (Mon, 03 Nov 2014)

Log Message

Rename FindIndicator{Window} to TextIndicator{Window}
https://bugs.webkit.org/show_bug.cgi?id=138302
<rdar://problem/18855190>

Reviewed by Anders Carlsson.

Rename FindIndicator{Window} to TextIndicator{Window} (and related),
because it will soon be used to indicate ranges of text that are not
necessarily find-in-page results.

FindController still has things named 'findIndicator' internally,
and I left the API alone (because all the API bits are actually find-specific),
but the actual FindIndicator/Window and the message to set it up, etc. are all
now called Text*.

* CMakeLists.txt:
* UIProcess/API/mac/WKView.mm:
* UIProcess/API/mac/WKViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/FindIndicator.cpp.
* UIProcess/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/FindIndicator.h.
* UIProcess/WebPageProxy.cpp:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
* UIProcess/ios/WKContentView.h:
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
* UIProcess/mac/TextIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h.
* UIProcess/mac/TextIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm.
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/FindController.cpp:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/CMakeLists.txt (175475 => 175476)


--- trunk/Source/WebKit2/CMakeLists.txt	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/CMakeLists.txt	2014-11-03 19:17:20 UTC (rev 175476)
@@ -289,7 +289,6 @@
     UIProcess/APISession.cpp
     UIProcess/BackingStore.cpp
     UIProcess/DrawingAreaProxy.cpp
-    UIProcess/FindIndicator.cpp
     UIProcess/FrameLoadState.cpp
     UIProcess/GeolocationPermissionRequestManagerProxy.cpp
     UIProcess/GeolocationPermissionRequestProxy.cpp
@@ -300,6 +299,7 @@
     UIProcess/ResponsivenessTimer.cpp
     UIProcess/StatisticsRequest.cpp
     UIProcess/TextCheckerCompletion.cpp
+    UIProcess/TextIndicator.cpp
     UIProcess/VisitedLinkProvider.cpp
     UIProcess/WebApplicationCacheManagerProxy.cpp
     UIProcess/WebBackForwardList.cpp

Modified: trunk/Source/WebKit2/ChangeLog (175475 => 175476)


--- trunk/Source/WebKit2/ChangeLog	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/ChangeLog	2014-11-03 19:17:20 UTC (rev 175476)
@@ -1,3 +1,39 @@
+2014-11-03  Tim Horton  <[email protected]>
+
+        Rename FindIndicator{Window} to TextIndicator{Window}
+        https://bugs.webkit.org/show_bug.cgi?id=138302
+        <rdar://problem/18855190>
+
+        Reviewed by Anders Carlsson.
+
+        Rename FindIndicator{Window} to TextIndicator{Window} (and related),
+        because it will soon be used to indicate ranges of text that are not
+        necessarily find-in-page results.
+
+        FindController still has things named 'findIndicator' internally,
+        and I left the API alone (because all the API bits are actually find-specific),
+        but the actual FindIndicator/Window and the message to set it up, etc. are all
+        now called Text*.
+
+        * CMakeLists.txt:
+        * UIProcess/API/mac/WKView.mm:
+        * UIProcess/API/mac/WKViewInternal.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/TextIndicator.cpp: Renamed from Source/WebKit2/UIProcess/FindIndicator.cpp.
+        * UIProcess/TextIndicator.h: Renamed from Source/WebKit2/UIProcess/FindIndicator.h.
+        * UIProcess/WebPageProxy.cpp:
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        * UIProcess/ios/WKContentView.h:
+        * UIProcess/mac/PageClientImpl.h:
+        * UIProcess/mac/PageClientImpl.mm:
+        * UIProcess/mac/TextIndicatorWindow.h: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h.
+        * UIProcess/mac/TextIndicatorWindow.mm: Renamed from Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm.
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebPage/FindController.cpp:
+
 2014-11-03  Beth Dakin  <[email protected]>
 
         Implement action menus for editable text

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-11-03 19:17:20 UTC (rev 175476)
@@ -40,8 +40,6 @@
 #import "DataReference.h"
 #import "EditingRange.h"
 #import "EditorState.h"
-#import "FindIndicator.h"
-#import "FindIndicatorWindow.h"
 #import "LayerTreeContext.h"
 #import "Logging.h"
 #import "NativeWebKeyboardEvent.h"
@@ -53,6 +51,8 @@
 #import "StringUtilities.h"
 #import "TextChecker.h"
 #import "TextCheckerState.h"
+#import "TextIndicator.h"
+#import "TextIndicatorWindow.h"
 #import "TiledCoreAnimationDrawingAreaProxy.h"
 #import "ViewGestureController.h"
 #import "ViewSnapshotStore.h"
@@ -182,7 +182,7 @@
     // For asynchronous validation.
     ValidationMap _validationMap;
 
-    std::unique_ptr<FindIndicatorWindow> _findIndicatorWindow;
+    std::unique_ptr<TextIndicatorWindow> _textIndicatorWindow;
 
     // We keep here the event when resending it to
     // the application to distinguish the case of a new event from one 
@@ -492,7 +492,7 @@
 - (void)renewGState
 {
     // Hide the find indicator.
-    _data->_findIndicatorWindow = nullptr;
+    _data->_textIndicatorWindow = nullptr;
 
     // Update the view frame.
     if ([self window])
@@ -3041,17 +3041,17 @@
     }
 }
 
-- (void)_setFindIndicator:(PassRefPtr<FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate
+- (void)_setTextIndicator:(PassRefPtr<TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate
 {
-    if (!findIndicator) {
-        _data->_findIndicatorWindow = nullptr;
+    if (!textIndicator) {
+        _data->_textIndicatorWindow = nullptr;
         return;
     }
 
-    if (!_data->_findIndicatorWindow)
-        _data->_findIndicatorWindow = std::make_unique<FindIndicatorWindow>(self);
+    if (!_data->_textIndicatorWindow)
+        _data->_textIndicatorWindow = std::make_unique<TextIndicatorWindow>(self);
 
-    _data->_findIndicatorWindow->setFindIndicator(findIndicator, fadeOut, animate);
+    _data->_textIndicatorWindow->setTextIndicator(textIndicator, fadeOut, animate);
 }
 
 - (CALayer *)_rootLayer

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -46,8 +46,8 @@
 
 namespace WebKit {
 class DrawingAreaProxy;
-class FindIndicator;
 class LayerTreeContext;
+class TextIndicator;
 class ViewSnapshot;
 class WebContext;
 struct ActionMenuHitTestResult;
@@ -80,7 +80,7 @@
 - (void)_setIntrinsicContentSize:(NSSize)intrinsicContentSize;
 - (NSRect)_convertToDeviceSpace:(NSRect)rect;
 - (NSRect)_convertToUserSpace:(NSRect)rect;
-- (void)_setFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate;
+- (void)_setTextIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator fadeOut:(BOOL)fadeOut animate:(BOOL)animate;
 
 - (void)_setAcceleratedCompositingModeRootLayer:(CALayer *)rootLayer;
 - (CALayer *)_acceleratedCompositingModeRootLayer;

Deleted: trunk/Source/WebKit2/UIProcess/FindIndicator.cpp (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/FindIndicator.cpp	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/FindIndicator.cpp	2014-11-03 19:17:20 UTC (rev 175476)
@@ -1,277 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "FindIndicator.h"
-
-#include "ShareableBitmap.h"
-#include <WebCore/GeometryUtilities.h>
-#include <WebCore/Gradient.h>
-#include <WebCore/GraphicsContext.h>
-#include <WebCore/IntRect.h>
-#include <WebCore/Path.h>
-
-#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101000
-#define ENABLE_LEGACY_FIND_INDICATOR_STYLE 1
-#else
-#define ENABLE_LEGACY_FIND_INDICATOR_STYLE 0
-#endif
-
-using namespace WebCore;
-
-#if ENABLE(LEGACY_FIND_INDICATOR_STYLE)
-static const float cornerRadius = 3.0;
-
-static const float shadowOffsetX = 0.0;
-static const float shadowOffsetY = 1.0;
-static const float shadowBlurRadius = 3.0;
-
-static const int shadowRed = 0;
-static const int shadowGreen = 0;
-static const int shadowBlue = 0;
-static const int shadowAlpha = 204;
-
-static const float lightBorderThickness = 1.0;
-static const float horizontalPaddingInsideLightBorder = 3.0;
-static const float verticalPaddingInsideLightBorder = 1.0;
-
-static const float horizontalBorderInsideShadow = lightBorderThickness + horizontalPaddingInsideLightBorder;
-static const float verticalBorderInsideShadow = lightBorderThickness + verticalPaddingInsideLightBorder;
-
-static const float leftBorderThickness = horizontalBorderInsideShadow + shadowOffsetX + shadowBlurRadius / 2.0;
-static const float topBorderThickness = verticalBorderInsideShadow - shadowOffsetY + shadowBlurRadius / 2.0;
-static const float rightBorderThickness = horizontalBorderInsideShadow - shadowOffsetX + shadowBlurRadius / 2.0;
-static const float bottomBorderThickness = verticalBorderInsideShadow + shadowOffsetY + shadowBlurRadius / 2.0;
-
-static const float horizontalOutsetToCenterOfLightBorder = horizontalBorderInsideShadow - lightBorderThickness / 2.0;
-static const float verticalOutsetToCenterOfLightBorder = verticalBorderInsideShadow - lightBorderThickness / 2.0;
-
-static const int lightBorderRed = 245;
-static const int lightBorderGreen = 230;
-static const int lightBorderBlue = 0;
-static const int lightBorderAlpha = 255;
-
-static const int gradientDarkRed = 237;
-static const int gradientDarkGreen = 204;
-static const int gradientDarkBlue = 0;
-static const int gradientDarkAlpha = 255;
-
-static const int gradientLightRed = 242;
-static const int gradientLightGreen = 239;
-static const int gradientLightBlue = 0;
-static const int gradientLightAlpha = 255;
-#else
-const float flatStyleHorizontalBorder = 2;
-const float flatStyleVerticalBorder = 1;
-const float flatShadowOffsetX = 0;
-const float flatShadowOffsetY = 5;
-const float flatShadowBlurRadius = 25;
-const float flatRimShadowBlurRadius = 2;
-#endif
-
-namespace WebKit {
-
-PassRefPtr<FindIndicator> FindIndicator::create(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle)
-{
-    RefPtr<ShareableBitmap> contentImage = ShareableBitmap::create(contentImageHandle);
-    if (!contentImage)
-        return 0;
-    ASSERT(contentImageScaleFactor != 1 || contentImage->size() == enclosingIntRect(selectionRectInWindowCoordinates).size());
-
-    return adoptRef(new FindIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImage.release()));
-}
-
-static FloatRect inflateRect(const FloatRect& rect, float inflateX, float inflateY)
-{
-    FloatRect inflatedRect = rect;
-    inflatedRect.inflateX(inflateX);
-    inflatedRect.inflateY(inflateY);
-    return inflatedRect;
-}
-
-static FloatRect outsetIndicatorRectIncludingShadow(const FloatRect rect)
-{
-#if ENABLE(LEGACY_FIND_INDICATOR_STYLE)
-    FloatRect outsetRect = rect;
-    outsetRect.move(-leftBorderThickness, -topBorderThickness);
-    outsetRect.expand(leftBorderThickness + rightBorderThickness, topBorderThickness + bottomBorderThickness);
-    return outsetRect;
-#else
-    return inflateRect(rect, flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder);
-#endif
-}
-
-static bool findIndicatorsForTextRectsOverlap(const Vector<FloatRect>& textRects)
-{
-    size_t count = textRects.size();
-    if (count <= 1)
-        return false;
-
-    Vector<FloatRect> indicatorRects;
-    indicatorRects.reserveInitialCapacity(count);
-
-    for (size_t i = 0; i < count; ++i) {
-        FloatRect indicatorRect = outsetIndicatorRectIncludingShadow(textRects[i]);
-
-        for (size_t j = indicatorRects.size(); j; ) {
-            --j;
-            if (indicatorRect.intersects(indicatorRects[j]))
-                return true;
-        }
-
-        indicatorRects.uncheckedAppend(indicatorRect);
-    }
-
-    return false;
-}
-
-FindIndicator::FindIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, PassRefPtr<ShareableBitmap> contentImage)
-    : m_selectionRectInWindowCoordinates(selectionRectInWindowCoordinates)
-    , m_textRectsInSelectionRectCoordinates(textRectsInSelectionRectCoordinates)
-    , m_contentImageScaleFactor(contentImageScaleFactor)
-    , m_contentImage(contentImage)
-{
-    if (findIndicatorsForTextRectsOverlap(m_textRectsInSelectionRectCoordinates)) {
-        m_textRectsInSelectionRectCoordinates[0] = unionRect(m_textRectsInSelectionRectCoordinates);
-        m_textRectsInSelectionRectCoordinates.shrink(1);
-    }
-}
-
-FindIndicator::~FindIndicator()
-{
-}
-
-FloatRect FindIndicator::frameRect() const
-{
-    return outsetIndicatorRectIncludingShadow(m_selectionRectInWindowCoordinates);
-}
-
-#if ENABLE(LEGACY_FIND_INDICATOR_STYLE)
-static inline Color lightBorderColor()
-{
-    return Color(lightBorderRed, lightBorderGreen, lightBorderBlue, lightBorderAlpha);
-}
-
-static inline Color shadowColor()
-{
-    return Color(shadowRed, shadowGreen, shadowBlue, shadowAlpha);
-}
-
-static inline Color gradientLightColor()
-{
-    return Color(gradientLightRed, gradientLightGreen, gradientLightBlue, gradientLightAlpha);
-}
-
-static inline Color gradientDarkColor()
-{
-    return Color(gradientDarkRed, gradientDarkGreen, gradientDarkBlue, gradientDarkAlpha);
-}
-
-static Path pathWithRoundedRect(const FloatRect& pathRect, float radius)
-{
-    Path path;
-    path.addRoundedRect(pathRect, FloatSize(radius, radius));
-
-    return path;
-}
-#else
-static inline Color flatHighlightColor()
-{
-    return Color(255, 255, 0, 255);
-}
-
-static inline Color flatRimShadowColor()
-{
-    return Color(0, 0, 0, 38);
-}
-
-static inline Color flatDropShadowColor()
-{
-    return Color(0, 0, 0, 51);
-}
-#endif
-    
-void FindIndicator::draw(GraphicsContext& graphicsContext, const IntRect& /*dirtyRect*/)
-{
-#if ENABLE(LEGACY_FIND_INDICATOR_STYLE)
-    for (size_t i = 0; i < m_textRectsInSelectionRectCoordinates.size(); ++i) {
-        FloatRect textRect = m_textRectsInSelectionRectCoordinates[i];
-        textRect.move(leftBorderThickness, topBorderThickness);
-
-        FloatRect outerPathRect = inflateRect(textRect, horizontalOutsetToCenterOfLightBorder, verticalOutsetToCenterOfLightBorder);
-        FloatRect innerPathRect = inflateRect(textRect, horizontalPaddingInsideLightBorder, verticalPaddingInsideLightBorder);
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, shadowColor(), ColorSpaceSRGB);
-            graphicsContext.setFillColor(lightBorderColor(), ColorSpaceDeviceRGB);
-            graphicsContext.fillPath(pathWithRoundedRect(outerPathRect, cornerRadius));
-        }
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.clip(pathWithRoundedRect(innerPathRect, cornerRadius));
-            RefPtr<Gradient> gradient = Gradient::create(FloatPoint(innerPathRect.x(), innerPathRect.y()), FloatPoint(innerPathRect.x(), innerPathRect.maxY()));
-            gradient->addColorStop(0, gradientLightColor());
-            gradient->addColorStop(1, gradientDarkColor());
-            graphicsContext.setFillGradient(gradient.releaseNonNull());
-            graphicsContext.fillRect(outerPathRect);
-        }
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.translate(FloatSize(roundf(leftBorderThickness), roundf(topBorderThickness)));
-
-            IntRect contentImageRect = enclosingIntRect(m_textRectsInSelectionRectCoordinates[i]);
-            m_contentImage->paint(graphicsContext, m_contentImageScaleFactor, contentImageRect.location(), contentImageRect);
-        }
-    }
-#else
-    for (auto& textRect : m_textRectsInSelectionRectCoordinates) {
-        FloatRect blurRect = textRect;
-        blurRect.move(flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder);
-        FloatRect outerPathRect = inflateRect(blurRect, flatStyleHorizontalBorder, flatStyleVerticalBorder);
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.setShadow(FloatSize(), flatRimShadowBlurRadius, flatRimShadowColor(), ColorSpaceSRGB);
-            graphicsContext.setFillColor(flatHighlightColor(), ColorSpaceSRGB);
-            graphicsContext.fillRect(outerPathRect);
-            graphicsContext.setShadow(FloatSize(flatShadowOffsetX, flatShadowOffsetY), flatShadowBlurRadius, flatDropShadowColor(), ColorSpaceSRGB);
-            graphicsContext.fillRect(outerPathRect);
-        }
-
-        {
-            GraphicsContextStateSaver stateSaver(graphicsContext);
-            graphicsContext.translate(FloatSize(flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder));
-
-            IntRect contentImageRect = enclosingIntRect(textRect);
-            m_contentImage->paint(graphicsContext, m_contentImageScaleFactor, contentImageRect.location(), contentImageRect);
-        }
-    }
-#endif
-}
-
-} // namespace WebKit

Deleted: trunk/Source/WebKit2/UIProcess/FindIndicator.h (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/FindIndicator.h	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/FindIndicator.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -1,64 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef FindIndicator_h
-#define FindIndicator_h
-
-#include "ShareableBitmap.h"
-#include <WebCore/FloatRect.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/Vector.h>
-
-namespace WebCore {
-    class GraphicsContext;
-}
-
-namespace WebKit {
-
-class FindIndicator : public RefCounted<FindIndicator> {
-public:
-    static PassRefPtr<FindIndicator> create(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle);
-    ~FindIndicator();
-
-    WebCore::FloatRect selectionRectInWindowCoordinates() const { return m_selectionRectInWindowCoordinates; }
-    WebCore::FloatRect frameRect() const;
-
-    ShareableBitmap* contentImage() const { return m_contentImage.get(); }
-
-    void draw(WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect);
-
-private:
-    FindIndicator(const WebCore::FloatRect& selectionRect, const Vector<WebCore::FloatRect>& textRects, float contentImageScaleFactor, PassRefPtr<ShareableBitmap> contentImage);
-
-    WebCore::FloatRect m_selectionRectInWindowCoordinates;
-    Vector<WebCore::FloatRect> m_textRectsInSelectionRectCoordinates;
-    float m_contentImageScaleFactor;
-    RefPtr<ShareableBitmap> m_contentImage;
-};
-
-} // namespace WebKit
-
-#endif // FindIndicator_h

Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/PageClient.h	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -54,7 +54,7 @@
 namespace WebKit {
 
 class DrawingAreaProxy;
-class FindIndicator;
+class TextIndicator;
 class NativeWebKeyboardEvent;
 class RemoteLayerTreeTransaction;
 class ViewSnapshot;
@@ -214,7 +214,7 @@
     virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) = 0;
 #endif
 
-    virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate) = 0;
+    virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut, bool animate) = 0;
 
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) = 0;
     virtual void exitAcceleratedCompositingMode() = 0;

Added: trunk/Source/WebKit2/UIProcess/TextIndicator.cpp (0 => 175476)


--- trunk/Source/WebKit2/UIProcess/TextIndicator.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/TextIndicator.cpp	2014-11-03 19:17:20 UTC (rev 175476)
@@ -0,0 +1,277 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "TextIndicator.h"
+
+#include "ShareableBitmap.h"
+#include <WebCore/GeometryUtilities.h>
+#include <WebCore/Gradient.h>
+#include <WebCore/GraphicsContext.h>
+#include <WebCore/IntRect.h>
+#include <WebCore/Path.h>
+
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101000
+#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 1
+#else
+#define ENABLE_LEGACY_TEXT_INDICATOR_STYLE 0
+#endif
+
+using namespace WebCore;
+
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+static const float cornerRadius = 3.0;
+
+static const float shadowOffsetX = 0.0;
+static const float shadowOffsetY = 1.0;
+static const float shadowBlurRadius = 3.0;
+
+static const int shadowRed = 0;
+static const int shadowGreen = 0;
+static const int shadowBlue = 0;
+static const int shadowAlpha = 204;
+
+static const float lightBorderThickness = 1.0;
+static const float horizontalPaddingInsideLightBorder = 3.0;
+static const float verticalPaddingInsideLightBorder = 1.0;
+
+static const float horizontalBorderInsideShadow = lightBorderThickness + horizontalPaddingInsideLightBorder;
+static const float verticalBorderInsideShadow = lightBorderThickness + verticalPaddingInsideLightBorder;
+
+static const float leftBorderThickness = horizontalBorderInsideShadow + shadowOffsetX + shadowBlurRadius / 2.0;
+static const float topBorderThickness = verticalBorderInsideShadow - shadowOffsetY + shadowBlurRadius / 2.0;
+static const float rightBorderThickness = horizontalBorderInsideShadow - shadowOffsetX + shadowBlurRadius / 2.0;
+static const float bottomBorderThickness = verticalBorderInsideShadow + shadowOffsetY + shadowBlurRadius / 2.0;
+
+static const float horizontalOutsetToCenterOfLightBorder = horizontalBorderInsideShadow - lightBorderThickness / 2.0;
+static const float verticalOutsetToCenterOfLightBorder = verticalBorderInsideShadow - lightBorderThickness / 2.0;
+
+static const int lightBorderRed = 245;
+static const int lightBorderGreen = 230;
+static const int lightBorderBlue = 0;
+static const int lightBorderAlpha = 255;
+
+static const int gradientDarkRed = 237;
+static const int gradientDarkGreen = 204;
+static const int gradientDarkBlue = 0;
+static const int gradientDarkAlpha = 255;
+
+static const int gradientLightRed = 242;
+static const int gradientLightGreen = 239;
+static const int gradientLightBlue = 0;
+static const int gradientLightAlpha = 255;
+#else
+const float flatStyleHorizontalBorder = 2;
+const float flatStyleVerticalBorder = 1;
+const float flatShadowOffsetX = 0;
+const float flatShadowOffsetY = 5;
+const float flatShadowBlurRadius = 25;
+const float flatRimShadowBlurRadius = 2;
+#endif
+
+namespace WebKit {
+
+PassRefPtr<TextIndicator> TextIndicator::create(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle)
+{
+    RefPtr<ShareableBitmap> contentImage = ShareableBitmap::create(contentImageHandle);
+    if (!contentImage)
+        return 0;
+    ASSERT(contentImageScaleFactor != 1 || contentImage->size() == enclosingIntRect(selectionRectInWindowCoordinates).size());
+
+    return adoptRef(new TextIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImage.release()));
+}
+
+static FloatRect inflateRect(const FloatRect& rect, float inflateX, float inflateY)
+{
+    FloatRect inflatedRect = rect;
+    inflatedRect.inflateX(inflateX);
+    inflatedRect.inflateY(inflateY);
+    return inflatedRect;
+}
+
+static FloatRect outsetIndicatorRectIncludingShadow(const FloatRect rect)
+{
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+    FloatRect outsetRect = rect;
+    outsetRect.move(-leftBorderThickness, -topBorderThickness);
+    outsetRect.expand(leftBorderThickness + rightBorderThickness, topBorderThickness + bottomBorderThickness);
+    return outsetRect;
+#else
+    return inflateRect(rect, flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder);
+#endif
+}
+
+static bool textIndicatorsForTextRectsOverlap(const Vector<FloatRect>& textRects)
+{
+    size_t count = textRects.size();
+    if (count <= 1)
+        return false;
+
+    Vector<FloatRect> indicatorRects;
+    indicatorRects.reserveInitialCapacity(count);
+
+    for (size_t i = 0; i < count; ++i) {
+        FloatRect indicatorRect = outsetIndicatorRectIncludingShadow(textRects[i]);
+
+        for (size_t j = indicatorRects.size(); j; ) {
+            --j;
+            if (indicatorRect.intersects(indicatorRects[j]))
+                return true;
+        }
+
+        indicatorRects.uncheckedAppend(indicatorRect);
+    }
+
+    return false;
+}
+
+TextIndicator::TextIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, PassRefPtr<ShareableBitmap> contentImage)
+    : m_selectionRectInWindowCoordinates(selectionRectInWindowCoordinates)
+    , m_textRectsInSelectionRectCoordinates(textRectsInSelectionRectCoordinates)
+    , m_contentImageScaleFactor(contentImageScaleFactor)
+    , m_contentImage(contentImage)
+{
+    if (textIndicatorsForTextRectsOverlap(m_textRectsInSelectionRectCoordinates)) {
+        m_textRectsInSelectionRectCoordinates[0] = unionRect(m_textRectsInSelectionRectCoordinates);
+        m_textRectsInSelectionRectCoordinates.shrink(1);
+    }
+}
+
+TextIndicator::~TextIndicator()
+{
+}
+
+FloatRect TextIndicator::frameRect() const
+{
+    return outsetIndicatorRectIncludingShadow(m_selectionRectInWindowCoordinates);
+}
+
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+static inline Color lightBorderColor()
+{
+    return Color(lightBorderRed, lightBorderGreen, lightBorderBlue, lightBorderAlpha);
+}
+
+static inline Color shadowColor()
+{
+    return Color(shadowRed, shadowGreen, shadowBlue, shadowAlpha);
+}
+
+static inline Color gradientLightColor()
+{
+    return Color(gradientLightRed, gradientLightGreen, gradientLightBlue, gradientLightAlpha);
+}
+
+static inline Color gradientDarkColor()
+{
+    return Color(gradientDarkRed, gradientDarkGreen, gradientDarkBlue, gradientDarkAlpha);
+}
+
+static Path pathWithRoundedRect(const FloatRect& pathRect, float radius)
+{
+    Path path;
+    path.addRoundedRect(pathRect, FloatSize(radius, radius));
+
+    return path;
+}
+#else
+static inline Color flatHighlightColor()
+{
+    return Color(255, 255, 0, 255);
+}
+
+static inline Color flatRimShadowColor()
+{
+    return Color(0, 0, 0, 38);
+}
+
+static inline Color flatDropShadowColor()
+{
+    return Color(0, 0, 0, 51);
+}
+#endif
+    
+void TextIndicator::draw(GraphicsContext& graphicsContext, const IntRect& /*dirtyRect*/)
+{
+#if ENABLE(LEGACY_TEXT_INDICATOR_STYLE)
+    for (size_t i = 0; i < m_textRectsInSelectionRectCoordinates.size(); ++i) {
+        FloatRect textRect = m_textRectsInSelectionRectCoordinates[i];
+        textRect.move(leftBorderThickness, topBorderThickness);
+
+        FloatRect outerPathRect = inflateRect(textRect, horizontalOutsetToCenterOfLightBorder, verticalOutsetToCenterOfLightBorder);
+        FloatRect innerPathRect = inflateRect(textRect, horizontalPaddingInsideLightBorder, verticalPaddingInsideLightBorder);
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.setShadow(FloatSize(shadowOffsetX, shadowOffsetY), shadowBlurRadius, shadowColor(), ColorSpaceSRGB);
+            graphicsContext.setFillColor(lightBorderColor(), ColorSpaceDeviceRGB);
+            graphicsContext.fillPath(pathWithRoundedRect(outerPathRect, cornerRadius));
+        }
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.clip(pathWithRoundedRect(innerPathRect, cornerRadius));
+            RefPtr<Gradient> gradient = Gradient::create(FloatPoint(innerPathRect.x(), innerPathRect.y()), FloatPoint(innerPathRect.x(), innerPathRect.maxY()));
+            gradient->addColorStop(0, gradientLightColor());
+            gradient->addColorStop(1, gradientDarkColor());
+            graphicsContext.setFillGradient(gradient.releaseNonNull());
+            graphicsContext.fillRect(outerPathRect);
+        }
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.translate(FloatSize(roundf(leftBorderThickness), roundf(topBorderThickness)));
+
+            IntRect contentImageRect = enclosingIntRect(m_textRectsInSelectionRectCoordinates[i]);
+            m_contentImage->paint(graphicsContext, m_contentImageScaleFactor, contentImageRect.location(), contentImageRect);
+        }
+    }
+#else
+    for (auto& textRect : m_textRectsInSelectionRectCoordinates) {
+        FloatRect blurRect = textRect;
+        blurRect.move(flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder);
+        FloatRect outerPathRect = inflateRect(blurRect, flatStyleHorizontalBorder, flatStyleVerticalBorder);
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.setShadow(FloatSize(), flatRimShadowBlurRadius, flatRimShadowColor(), ColorSpaceSRGB);
+            graphicsContext.setFillColor(flatHighlightColor(), ColorSpaceSRGB);
+            graphicsContext.fillRect(outerPathRect);
+            graphicsContext.setShadow(FloatSize(flatShadowOffsetX, flatShadowOffsetY), flatShadowBlurRadius, flatDropShadowColor(), ColorSpaceSRGB);
+            graphicsContext.fillRect(outerPathRect);
+        }
+
+        {
+            GraphicsContextStateSaver stateSaver(graphicsContext);
+            graphicsContext.translate(FloatSize(flatShadowBlurRadius + flatStyleHorizontalBorder, flatShadowBlurRadius + flatStyleVerticalBorder));
+
+            IntRect contentImageRect = enclosingIntRect(textRect);
+            m_contentImage->paint(graphicsContext, m_contentImageScaleFactor, contentImageRect.location(), contentImageRect);
+        }
+    }
+#endif
+}
+
+} // namespace WebKit

Added: trunk/Source/WebKit2/UIProcess/TextIndicator.h (0 => 175476)


--- trunk/Source/WebKit2/UIProcess/TextIndicator.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/TextIndicator.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TextIndicator_h
+#define TextIndicator_h
+
+#include "ShareableBitmap.h"
+#include <WebCore/FloatRect.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+class GraphicsContext;
+}
+
+namespace WebKit {
+
+class TextIndicator : public RefCounted<TextIndicator> {
+public:
+    static PassRefPtr<TextIndicator> create(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle);
+    ~TextIndicator();
+
+    WebCore::FloatRect selectionRectInWindowCoordinates() const { return m_selectionRectInWindowCoordinates; }
+    WebCore::FloatRect frameRect() const;
+
+    ShareableBitmap* contentImage() const { return m_contentImage.get(); }
+
+    void draw(WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect);
+
+private:
+    TextIndicator(const WebCore::FloatRect& selectionRect, const Vector<WebCore::FloatRect>& textRects, float contentImageScaleFactor, PassRefPtr<ShareableBitmap> contentImage);
+
+    WebCore::FloatRect m_selectionRectInWindowCoordinates;
+    Vector<WebCore::FloatRect> m_textRectsInSelectionRectCoordinates;
+    float m_contentImageScaleFactor;
+    RefPtr<ShareableBitmap> m_contentImage;
+};
+
+} // namespace WebKit
+
+#endif // TextIndicator_h

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-11-03 19:17:20 UTC (rev 175476)
@@ -41,7 +41,6 @@
 #include "DrawingAreaProxy.h"
 #include "DrawingAreaProxyMessages.h"
 #include "EventDispatcherMessages.h"
-#include "FindIndicator.h"
 #include "Logging.h"
 #include "NativeWebKeyboardEvent.h"
 #include "NativeWebMouseEvent.h"
@@ -55,6 +54,7 @@
 #include "PrintInfo.h"
 #include "TextChecker.h"
 #include "TextCheckerState.h"
+#include "TextIndicator.h"
 #include "WKContextPrivate.h"
 #include "WebBackForwardList.h"
 #include "WebBackForwardListItem.h"
@@ -3625,10 +3625,10 @@
     m_findMatchesClient.didGetImageForMatchResult(this, WebImage::create(ShareableBitmap::create(contentImageHandle)).get(), matchIndex);
 }
 
-void WebPageProxy::setFindIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate)
+void WebPageProxy::setTextIndicator(const FloatRect& selectionRectInWindowCoordinates, const Vector<FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate)
 {
-    RefPtr<FindIndicator> findIndicator = FindIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImageHandle);
-    m_pageClient.setFindIndicator(findIndicator.release(), fadeOut, animate);
+    RefPtr<TextIndicator> textIndicator = TextIndicator::create(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, contentImageScaleFactor, contentImageHandle);
+    m_pageClient.setTextIndicator(textIndicator.release(), fadeOut, animate);
 }
 
 void WebPageProxy::didFindString(const String& string, uint32_t matchCount, int32_t matchIndex)

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -661,7 +661,7 @@
     void hideFindUI();
     void countStringMatches(const String&, FindOptions, unsigned maxMatchCount);
     void didCountStringMatches(const String&, uint32_t matchCount);
-    void setFindIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate);
+    void setTextIndicator(const WebCore::FloatRect& selectionRectInWindowCoordinates, const Vector<WebCore::FloatRect>& textRectsInSelectionRectCoordinates, float contentImageScaleFactor, const ShareableBitmap::Handle& contentImageHandle, bool fadeOut, bool animate);
     void didFindString(const String&, uint32_t matchCount, int32_t matchIndex);
     void didFailToFindString(const String&);
     void didFindStringMatches(const String&, const Vector<Vector<WebCore::IntRect>>& matchRects, int32_t firstIndexAfterSelection);

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2014-11-03 19:17:20 UTC (rev 175476)
@@ -228,7 +228,7 @@
 
     # Find messages
     DidCountStringMatches(String string, uint32_t matchCount)
-    SetFindIndicator(WebCore::FloatRect selectionRect, Vector<WebCore::FloatRect> textRects, float contentImageScaleFactor, WebKit::ShareableBitmap::Handle contentImageHandle, bool fadeOut, bool animate)
+    SetTextIndicator(WebCore::FloatRect selectionRect, Vector<WebCore::FloatRect> textRects, float contentImageScaleFactor, WebKit::ShareableBitmap::Handle contentImageHandle, bool fadeOut, bool animate)
     DidFindString(String string, uint32_t matchCount, int32_t matchIndex)
     DidFailToFindString(String string)
     DidFindStringMatches(String string, Vector<Vector<WebCore::IntRect>> matches, int32_t firstIndexAfterSelection)

Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -96,7 +96,7 @@
 #endif
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) override;
     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) override;
-    virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate) override;
+    virtual void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut, bool animate) override;
 
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&) override;
     virtual void exitAcceleratedCompositingMode() override;

Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm	2014-11-03 19:17:20 UTC (rev 175476)
@@ -31,10 +31,10 @@
 #import "APIData.h"
 #import "DataReference.h"
 #import "DownloadProxy.h"
-#import "FindIndicator.h"
 #import "InteractionInformationAtPosition.h"
 #import "NativeWebKeyboardEvent.h"
 #import "NavigationState.h"
+#import "TextIndicator.h"
 #import "ViewSnapshotStore.h"
 #import "WKContentView.h"
 #import "WKContentViewInteraction.h"
@@ -440,7 +440,7 @@
     return 0;
 }
 
-void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut, bool animate)
+void PageClientImpl::setTextIndicator(PassRefPtr<TextIndicator> textIndicator, bool fadeOut, bool animate)
 {
 }
 

Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.h (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.h	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -39,9 +39,9 @@
 
 namespace WebKit {
 class DrawingAreaProxy;
-class FindIndicator;
 class GeolocationPermissionRequestProxy;
 class RemoteLayerTreeTransaction;
+class TextIndicator;
 class WebContext;
 class WebFrameProxy;
 class WebPageProxy;

Deleted: trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef FindIndicatorWindow_h
-#define FindIndicatorWindow_h
-
-#if PLATFORM(MAC)
-
-#import "WebKitSystemInterface.h"
-#import <wtf/Noncopyable.h>
-#import <wtf/RefPtr.h>
-#import <wtf/RetainPtr.h>
-#import <wtf/RunLoop.h>
-
-@class WKFindIndicatorWindowAnimation;
-@class WKView;
-
-namespace WebKit {
-
-class FindIndicator;
-
-class FindIndicatorWindow {
-    WTF_MAKE_NONCOPYABLE(FindIndicatorWindow);
-
-public:
-    explicit FindIndicatorWindow(WKView *);
-    ~FindIndicatorWindow();
-
-    void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate);
-
-private:
-    void closeWindow();
-
-    void startFadeOutTimerFired();
-
-    void fadeOutAnimationCallback(double);
-    void fadeOutAnimationDidEnd();
-
-    void bounceAnimationCallback(double);
-    void bounceAnimationDidEnd();
-
-    WKView* m_wkView;
-    RefPtr<FindIndicator> m_findIndicator;
-    RetainPtr<NSWindow> m_findIndicatorWindow;
-
-    WKWindowBounceAnimationContextRef m_bounceAnimationContext;
-    RetainPtr<WKFindIndicatorWindowAnimation> m_bounceAnimation;
-
-    RunLoop::Timer<FindIndicatorWindow> m_startFadeOutTimer;
-    RetainPtr<WKFindIndicatorWindowAnimation> m_fadeOutAnimation;
-};
-
-} // namespace WebKit
-
-#endif // FindIndicatorWindow_h
-
-#endif // PLATFORM(MAC)

Deleted: trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/mac/FindIndicatorWindow.mm	2014-11-03 19:17:20 UTC (rev 175476)
@@ -1,250 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#import "config.h"
-#import "FindIndicatorWindow.h"
-
-#if PLATFORM(MAC)
-
-#import "FindIndicator.h"
-#import "WKView.h"
-#import <WebCore/GraphicsContext.h>
-
-static const double bounceAnimationDuration = 0.12;
-static const double timeBeforeFadeStarts = bounceAnimationDuration + 0.2;
-static const double fadeOutAnimationDuration = 0.3;
-
-using namespace WebCore;
-
-@interface WKFindIndicatorView : NSView {
-    RefPtr<WebKit::FindIndicator> _findIndicator;
-}
-
-- (id)_initWithFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator;
-@end
-
-@implementation WKFindIndicatorView
-
-- (id)_initWithFindIndicator:(PassRefPtr<WebKit::FindIndicator>)findIndicator
-{
-    if ((self = [super initWithFrame:NSZeroRect]))
-        _findIndicator = findIndicator;
-
-    return self;
-}
-
-- (void)drawRect:(NSRect)rect
-{
-    GraphicsContext graphicsContext(static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]));
-
-    _findIndicator->draw(graphicsContext, enclosingIntRect(rect));
-}
-
-- (BOOL)isFlipped
-{
-    return YES;
-}
-
-@end
-
-@interface WKFindIndicatorWindowAnimation : NSAnimation<NSAnimationDelegate> {
-    WebKit::FindIndicatorWindow* _findIndicatorWindow;
-    void (WebKit::FindIndicatorWindow::*_animationProgressCallback)(double progress);
-    void (WebKit::FindIndicatorWindow::*_animationDidEndCallback)();
-}
-
-- (id)_initWithFindIndicatorWindow:(WebKit::FindIndicatorWindow *)findIndicatorWindow 
-                 animationDuration:(CFTimeInterval)duration
-         animationProgressCallback:(void (WebKit::FindIndicatorWindow::*)(double progress))animationProgressCallback
-           animationDidEndCallback:(void (WebKit::FindIndicatorWindow::*)())animationDidEndCallback;
-@end
-
-@implementation WKFindIndicatorWindowAnimation
-
-- (id)_initWithFindIndicatorWindow:(WebKit::FindIndicatorWindow *)findIndicatorWindow 
-                 animationDuration:(CFTimeInterval)animationDuration
-         animationProgressCallback:(void (WebKit::FindIndicatorWindow::*)(double progress))animationProgressCallback
-           animationDidEndCallback:(void (WebKit::FindIndicatorWindow::*)())animationDidEndCallback
-{
-    if ((self = [super initWithDuration:animationDuration animationCurve:NSAnimationEaseInOut])) {
-        _findIndicatorWindow = findIndicatorWindow;
-        _animationProgressCallback = animationProgressCallback;
-        _animationDidEndCallback = animationDidEndCallback;
-        [self setDelegate:self];
-        [self setAnimationBlockingMode:NSAnimationNonblocking];
-    }
-    return self;
-}
-
-- (void)setCurrentProgress:(NSAnimationProgress)progress
-{
-    (_findIndicatorWindow->*_animationProgressCallback)(progress);
-}
-
-- (void)animationDidEnd:(NSAnimation *)animation
-{
-    ASSERT(animation == self);
-
-    (_findIndicatorWindow->*_animationDidEndCallback)();
-}
-
-@end
-
-namespace WebKit {
-
-FindIndicatorWindow::FindIndicatorWindow(WKView *wkView)
-    : m_wkView(wkView)
-    , m_bounceAnimationContext(0)
-    , m_startFadeOutTimer(RunLoop::main(), this, &FindIndicatorWindow::startFadeOutTimerFired)
-{
-}
-
-FindIndicatorWindow::~FindIndicatorWindow()
-{
-    closeWindow();
-}
-
-void FindIndicatorWindow::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut, bool animate)
-{
-    if (m_findIndicator == findIndicator)
-        return;
-
-    m_findIndicator = findIndicator;
-
-    // Get rid of the old window.
-    closeWindow();
-
-    if (!m_findIndicator)
-        return;
-
-    NSRect contentRect = m_findIndicator->frameRect();
-    NSRect windowFrameRect = NSIntegralRect([m_wkView convertRect:contentRect toView:nil]);
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
-    windowFrameRect.origin = [[m_wkView window] convertBaseToScreen:windowFrameRect.origin];
-#pragma clang diagnostic pop
-    NSRect windowContentRect = [NSWindow contentRectForFrameRect:windowFrameRect styleMask:NSBorderlessWindowMask];
-    
-    m_findIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:windowContentRect 
-                                                              styleMask:NSBorderlessWindowMask 
-                                                                backing:NSBackingStoreBuffered
-                                                                  defer:NO]);
-
-    [m_findIndicatorWindow setBackgroundColor:[NSColor clearColor]];
-    [m_findIndicatorWindow setOpaque:NO];
-    [m_findIndicatorWindow setIgnoresMouseEvents:YES];
-
-    RetainPtr<WKFindIndicatorView> findIndicatorView = adoptNS([[WKFindIndicatorView alloc] _initWithFindIndicator:m_findIndicator]);
-    [m_findIndicatorWindow setContentView:findIndicatorView.get()];
-
-    [[m_wkView window] addChildWindow:m_findIndicatorWindow.get() ordered:NSWindowAbove];
-    [m_findIndicatorWindow setReleasedWhenClosed:NO];
-
-    if (animate) {
-        // Start the bounce animation.
-        m_bounceAnimationContext = WKWindowBounceAnimationContextCreate(m_findIndicatorWindow.get());
-        m_bounceAnimation = adoptNS([[WKFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this
-                                                                                    animationDuration:bounceAnimationDuration
-                                                                            animationProgressCallback:&FindIndicatorWindow::bounceAnimationCallback
-                                                                              animationDidEndCallback:&FindIndicatorWindow::bounceAnimationDidEnd]);
-        [m_bounceAnimation startAnimation];
-    }
-
-    if (fadeOut)
-        m_startFadeOutTimer.startOneShot(timeBeforeFadeStarts);
-}
-
-void FindIndicatorWindow::closeWindow()
-{
-    if (!m_findIndicatorWindow)
-        return;
-
-    m_startFadeOutTimer.stop();
-
-    if (m_fadeOutAnimation) {
-        [m_fadeOutAnimation stopAnimation];
-        m_fadeOutAnimation = nullptr;
-    }
-
-    if (m_bounceAnimation) {
-        [m_bounceAnimation stopAnimation];
-        m_bounceAnimation = nullptr;
-    }
-
-    if (m_bounceAnimationContext)
-        WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
-    
-    [[m_findIndicatorWindow parentWindow] removeChildWindow:m_findIndicatorWindow.get()];
-    [m_findIndicatorWindow close];
-    m_findIndicatorWindow = nullptr;
-}
-
-void FindIndicatorWindow::startFadeOutTimerFired()
-{
-    ASSERT(!m_fadeOutAnimation);
-    
-    m_fadeOutAnimation = adoptNS([[WKFindIndicatorWindowAnimation alloc] _initWithFindIndicatorWindow:this
-                                                                                   animationDuration:fadeOutAnimationDuration
-                                                                           animationProgressCallback:&FindIndicatorWindow::fadeOutAnimationCallback
-                                                                             animationDidEndCallback:&FindIndicatorWindow::fadeOutAnimationDidEnd]);
-    [m_fadeOutAnimation startAnimation];
-}
-                        
-void FindIndicatorWindow::fadeOutAnimationCallback(double progress)
-{
-    ASSERT(m_fadeOutAnimation);
-
-    [m_findIndicatorWindow setAlphaValue:1.0 - progress];
-}
-
-void FindIndicatorWindow::fadeOutAnimationDidEnd()
-{
-    ASSERT(m_fadeOutAnimation);
-    ASSERT(m_findIndicatorWindow);
-
-    closeWindow();
-}
-
-void FindIndicatorWindow::bounceAnimationCallback(double progress)
-{
-    ASSERT(m_bounceAnimation);
-    ASSERT(m_bounceAnimationContext);
-
-    WKWindowBounceAnimationSetAnimationProgress(m_bounceAnimationContext, progress);
-}
-
-void FindIndicatorWindow::bounceAnimationDidEnd()
-{
-    ASSERT(m_bounceAnimation);
-    ASSERT(m_bounceAnimationContext);
-    ASSERT(m_findIndicatorWindow);
-
-    WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
-    m_bounceAnimationContext = 0;
-}
-
-} // namespace WebKit
-
-#endif // PLATFORM(MAC)

Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -42,7 +42,7 @@
 }
 
 namespace WebKit {
-class FindIndicatorWindow;
+class TextIndicatorWindow;
 
 class PageClientImpl final : public PageClient
 #if ENABLE(FULLSCREEN_API)
@@ -120,7 +120,7 @@
     virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&);
 #endif
 
-    void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate);
+    void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut, bool animate);
 
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
     virtual void exitAcceleratedCompositingMode();

Modified: trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (175475 => 175476)


--- trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/UIProcess/mac/PageClientImpl.mm	2014-11-03 19:17:20 UTC (rev 175476)
@@ -33,11 +33,11 @@
 #import "DataReference.h"
 #import "DictionaryPopupInfo.h"
 #import "DownloadProxy.h"
-#import "FindIndicator.h"
 #import "NativeWebKeyboardEvent.h"
 #import "NativeWebWheelEvent.h"
 #import "NavigationState.h"
 #import "StringUtilities.h"
+#import "TextIndicator.h"
 #import "ViewSnapshotStore.h"
 #import "WKAPICast.h"
 #import "WKFullScreenWindowController.h"
@@ -467,9 +467,9 @@
 }
 #endif
 
-void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut, bool animate)
+void PageClientImpl::setTextIndicator(PassRefPtr<TextIndicator> textIndicator, bool fadeOut, bool animate)
 {
-    [m_wkView _setFindIndicator:findIndicator fadeOut:fadeOut animate:animate];
+    [m_wkView _setTextIndicator:textIndicator fadeOut:fadeOut animate:animate];
 }
 
 void PageClientImpl::accessibilityWebProcessTokenReceived(const IPC::DataReference& data)
@@ -685,7 +685,7 @@
 void PageClientImpl::navigationGestureDidBegin()
 {
     // Hide the finde indicator if it's visible.
-    setFindIndicator(nullptr, false, false);
+    setTextIndicator(nullptr, false, false);
 
 #if WK_API_ENABLED
     if (m_webView)

Added: trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h (0 => 175476)


--- trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.h	2014-11-03 19:17:20 UTC (rev 175476)
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef TextIndicatorWindow_h
+#define TextIndicatorWindow_h
+
+#if PLATFORM(MAC)
+
+#import "WebKitSystemInterface.h"
+#import <wtf/Noncopyable.h>
+#import <wtf/RefPtr.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/RunLoop.h>
+
+@class WKTextIndicatorWindowAnimation;
+@class WKView;
+
+namespace WebKit {
+
+class TextIndicator;
+
+class TextIndicatorWindow {
+    WTF_MAKE_NONCOPYABLE(TextIndicatorWindow);
+
+public:
+    explicit TextIndicatorWindow(WKView *);
+    ~TextIndicatorWindow();
+
+    void setTextIndicator(PassRefPtr<TextIndicator>, bool fadeOut, bool animate);
+
+private:
+    void closeWindow();
+
+    void startFadeOutTimerFired();
+
+    void fadeOutAnimationCallback(double);
+    void fadeOutAnimationDidEnd();
+
+    void bounceAnimationCallback(double);
+    void bounceAnimationDidEnd();
+
+    WKView* m_wkView;
+    RefPtr<TextIndicator> m_textIndicator;
+    RetainPtr<NSWindow> m_textIndicatorWindow;
+
+    WKWindowBounceAnimationContextRef m_bounceAnimationContext;
+    RetainPtr<WKTextIndicatorWindowAnimation> m_bounceAnimation;
+
+    RunLoop::Timer<TextIndicatorWindow> m_startFadeOutTimer;
+    RetainPtr<WKTextIndicatorWindowAnimation> m_fadeOutAnimation;
+};
+
+} // namespace WebKit
+
+#endif // TextIndicatorWindow_h
+
+#endif // PLATFORM(MAC)

Added: trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm (0 => 175476)


--- trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/mac/TextIndicatorWindow.mm	2014-11-03 19:17:20 UTC (rev 175476)
@@ -0,0 +1,237 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "TextIndicatorWindow.h"
+
+#if PLATFORM(MAC)
+
+#import "TextIndicator.h"
+#import "WKView.h"
+#import <WebCore/GraphicsContext.h>
+
+static const double bounceAnimationDuration = 0.12;
+static const double timeBeforeFadeStarts = bounceAnimationDuration + 0.2;
+static const double fadeOutAnimationDuration = 0.3;
+
+using namespace WebCore;
+
+@interface WKTextIndicatorView : NSView {
+    RefPtr<WebKit::TextIndicator> _textIndicator;
+}
+
+- (id)_initWithTextIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator;
+@end
+
+@implementation WKTextIndicatorView
+
+- (id)_initWithTextIndicator:(PassRefPtr<WebKit::TextIndicator>)textIndicator
+{
+    if ((self = [super initWithFrame:NSZeroRect]))
+        _textIndicator = textIndicator;
+
+    return self;
+}
+
+- (void)drawRect:(NSRect)rect
+{
+    GraphicsContext graphicsContext(static_cast<CGContextRef>([[NSGraphicsContext currentContext] graphicsPort]));
+
+    _textIndicator->draw(graphicsContext, enclosingIntRect(rect));
+}
+
+- (BOOL)isFlipped
+{
+    return YES;
+}
+
+@end
+
+@interface WKTextIndicatorWindowAnimation : NSAnimation<NSAnimationDelegate> {
+    WebKit::TextIndicatorWindow* _textIndicatorWindow;
+    void (WebKit::TextIndicatorWindow::*_animationProgressCallback)(double progress);
+    void (WebKit::TextIndicatorWindow::*_animationDidEndCallback)();
+}
+
+- (id)_initWithTextIndicatorWindow:(WebKit::TextIndicatorWindow *)textIndicatorWindow animationDuration:(CFTimeInterval)duration animationProgressCallback:(void (WebKit::TextIndicatorWindow::*)(double progress))animationProgressCallback animationDidEndCallback:(void (WebKit::TextIndicatorWindow::*)())animationDidEndCallback;
+@end
+
+@implementation WKTextIndicatorWindowAnimation
+
+- (id)_initWithTextIndicatorWindow:(WebKit::TextIndicatorWindow *)textIndicatorWindow animationDuration:(CFTimeInterval)animationDuration animationProgressCallback:(void (WebKit::TextIndicatorWindow::*)(double progress))animationProgressCallback animationDidEndCallback:(void (WebKit::TextIndicatorWindow::*)())animationDidEndCallback
+{
+    if ((self = [super initWithDuration:animationDuration animationCurve:NSAnimationEaseInOut])) {
+        _textIndicatorWindow = textIndicatorWindow;
+        _animationProgressCallback = animationProgressCallback;
+        _animationDidEndCallback = animationDidEndCallback;
+        [self setDelegate:self];
+        [self setAnimationBlockingMode:NSAnimationNonblocking];
+    }
+    return self;
+}
+
+- (void)setCurrentProgress:(NSAnimationProgress)progress
+{
+    (_textIndicatorWindow->*_animationProgressCallback)(progress);
+}
+
+- (void)animationDidEnd:(NSAnimation *)animation
+{
+    ASSERT(animation == self);
+
+    (_textIndicatorWindow->*_animationDidEndCallback)();
+}
+
+@end
+
+namespace WebKit {
+
+TextIndicatorWindow::TextIndicatorWindow(WKView *wkView)
+    : m_wkView(wkView)
+    , m_bounceAnimationContext(0)
+    , m_startFadeOutTimer(RunLoop::main(), this, &TextIndicatorWindow::startFadeOutTimerFired)
+{
+}
+
+TextIndicatorWindow::~TextIndicatorWindow()
+{
+    closeWindow();
+}
+
+void TextIndicatorWindow::setTextIndicator(PassRefPtr<TextIndicator> textIndicator, bool fadeOut, bool animate)
+{
+    if (m_textIndicator == textIndicator)
+        return;
+
+    m_textIndicator = textIndicator;
+
+    // Get rid of the old window.
+    closeWindow();
+
+    if (!m_textIndicator)
+        return;
+
+    NSRect contentRect = m_textIndicator->frameRect();
+    NSRect windowFrameRect = NSIntegralRect([m_wkView convertRect:contentRect toView:nil]);
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+    windowFrameRect.origin = [[m_wkView window] convertBaseToScreen:windowFrameRect.origin];
+#pragma clang diagnostic pop
+    NSRect windowContentRect = [NSWindow contentRectForFrameRect:windowFrameRect styleMask:NSBorderlessWindowMask];
+    
+    m_textIndicatorWindow = adoptNS([[NSWindow alloc] initWithContentRect:windowContentRect styleMask:NSBorderlessWindowMask backing:NSBackingStoreBuffered defer:NO]);
+
+    [m_textIndicatorWindow setBackgroundColor:[NSColor clearColor]];
+    [m_textIndicatorWindow setOpaque:NO];
+    [m_textIndicatorWindow setIgnoresMouseEvents:YES];
+
+    RetainPtr<WKTextIndicatorView> textIndicatorView = adoptNS([[WKTextIndicatorView alloc] _initWithTextIndicator:m_textIndicator]);
+    [m_textIndicatorWindow setContentView:textIndicatorView.get()];
+
+    [[m_wkView window] addChildWindow:m_textIndicatorWindow.get() ordered:NSWindowAbove];
+    [m_textIndicatorWindow setReleasedWhenClosed:NO];
+
+    if (animate) {
+        // Start the bounce animation.
+        m_bounceAnimationContext = WKWindowBounceAnimationContextCreate(m_textIndicatorWindow.get());
+        m_bounceAnimation = adoptNS([[WKTextIndicatorWindowAnimation alloc] _initWithTextIndicatorWindow:this animationDuration:bounceAnimationDuration
+            animationProgressCallback:&TextIndicatorWindow::bounceAnimationCallback animationDidEndCallback:&TextIndicatorWindow::bounceAnimationDidEnd]);
+        [m_bounceAnimation startAnimation];
+    }
+
+    if (fadeOut)
+        m_startFadeOutTimer.startOneShot(timeBeforeFadeStarts);
+}
+
+void TextIndicatorWindow::closeWindow()
+{
+    if (!m_textIndicatorWindow)
+        return;
+
+    m_startFadeOutTimer.stop();
+
+    if (m_fadeOutAnimation) {
+        [m_fadeOutAnimation stopAnimation];
+        m_fadeOutAnimation = nullptr;
+    }
+
+    if (m_bounceAnimation) {
+        [m_bounceAnimation stopAnimation];
+        m_bounceAnimation = nullptr;
+    }
+
+    if (m_bounceAnimationContext)
+        WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
+    
+    [[m_textIndicatorWindow parentWindow] removeChildWindow:m_textIndicatorWindow.get()];
+    [m_textIndicatorWindow close];
+    m_textIndicatorWindow = nullptr;
+}
+
+void TextIndicatorWindow::startFadeOutTimerFired()
+{
+    ASSERT(!m_fadeOutAnimation);
+    
+    m_fadeOutAnimation = adoptNS([[WKTextIndicatorWindowAnimation alloc] _initWithTextIndicatorWindow:this animationDuration:fadeOutAnimationDuration
+        animationProgressCallback:&TextIndicatorWindow::fadeOutAnimationCallback animationDidEndCallback:&TextIndicatorWindow::fadeOutAnimationDidEnd]);
+    [m_fadeOutAnimation startAnimation];
+}
+
+void TextIndicatorWindow::fadeOutAnimationCallback(double progress)
+{
+    ASSERT(m_fadeOutAnimation);
+
+    [m_textIndicatorWindow setAlphaValue:1.0 - progress];
+}
+
+void TextIndicatorWindow::fadeOutAnimationDidEnd()
+{
+    ASSERT(m_fadeOutAnimation);
+    ASSERT(m_textIndicatorWindow);
+
+    closeWindow();
+}
+
+void TextIndicatorWindow::bounceAnimationCallback(double progress)
+{
+    ASSERT(m_bounceAnimation);
+    ASSERT(m_bounceAnimationContext);
+
+    WKWindowBounceAnimationSetAnimationProgress(m_bounceAnimationContext, progress);
+}
+
+void TextIndicatorWindow::bounceAnimationDidEnd()
+{
+    ASSERT(m_bounceAnimation);
+    ASSERT(m_bounceAnimationContext);
+    ASSERT(m_textIndicatorWindow);
+
+    WKWindowBounceAnimationContextDestroy(m_bounceAnimationContext);
+    m_bounceAnimationContext = 0;
+}
+
+} // namespace WebKit
+
+#endif // PLATFORM(MAC)

Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (175475 => 175476)


--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj	2014-11-03 19:17:20 UTC (rev 175476)
@@ -110,8 +110,8 @@
 		0FCB4E5118BBE044000FCFC9 /* WKGeolocationProviderIOSObjCSecurityOrigin.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E4118BBE044000FCFC9 /* WKGeolocationProviderIOSObjCSecurityOrigin.mm */; };
 		0FCB4E5418BBE044000FCFC9 /* WKScrollView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E4418BBE044000FCFC9 /* WKScrollView.h */; };
 		0FCB4E5518BBE044000FCFC9 /* WKScrollView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E4518BBE044000FCFC9 /* WKScrollView.mm */; };
-		0FCB4E6018BBE3D9000FCFC9 /* FindIndicatorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5618BBE3D9000FCFC9 /* FindIndicatorWindow.h */; };
-		0FCB4E6118BBE3D9000FCFC9 /* FindIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E5718BBE3D9000FCFC9 /* FindIndicatorWindow.mm */; };
+		0FCB4E6018BBE3D9000FCFC9 /* TextIndicatorWindow.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5618BBE3D9000FCFC9 /* TextIndicatorWindow.h */; };
+		0FCB4E6118BBE3D9000FCFC9 /* TextIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E5718BBE3D9000FCFC9 /* TextIndicatorWindow.mm */; };
 		0FCB4E6218BBE3D9000FCFC9 /* PageClientImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5818BBE3D9000FCFC9 /* PageClientImpl.h */; };
 		0FCB4E6318BBE3D9000FCFC9 /* PageClientImpl.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0FCB4E5918BBE3D9000FCFC9 /* PageClientImpl.mm */; };
 		0FCB4E6618BBE3D9000FCFC9 /* WKPrintingView.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FCB4E5C18BBE3D9000FCFC9 /* WKPrintingView.h */; };
@@ -307,8 +307,8 @@
 		1A90C1EE1264FD50003E44D4 /* WebFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A90C1ED1264FD50003E44D4 /* WebFindOptions.h */; };
 		1A90C1F41264FD71003E44D4 /* FindController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A90C1F21264FD71003E44D4 /* FindController.h */; };
 		1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A90C1F31264FD71003E44D4 /* FindController.cpp */; };
-		1A910071126675C4001842F5 /* FindIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A91006F126675C3001842F5 /* FindIndicator.h */; };
-		1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A910070126675C4001842F5 /* FindIndicator.cpp */; };
+		1A910071126675C4001842F5 /* TextIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A91006F126675C3001842F5 /* TextIndicator.h */; };
+		1A910072126675C4001842F5 /* TextIndicator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A910070126675C4001842F5 /* TextIndicator.cpp */; };
 		1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */; };
 		1A92DC1312F8BAB90017AF65 /* LayerTreeContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A92DC1212F8BAB90017AF65 /* LayerTreeContext.cpp */; };
 		1A9E32891821636900F5D04C /* _WKRemoteObjectRegistry.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9E32871821636900F5D04C /* _WKRemoteObjectRegistry.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2054,8 +2054,8 @@
 		0FCB4E4118BBE044000FCFC9 /* WKGeolocationProviderIOSObjCSecurityOrigin.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKGeolocationProviderIOSObjCSecurityOrigin.mm; path = ios/WKGeolocationProviderIOSObjCSecurityOrigin.mm; sourceTree = "<group>"; };
 		0FCB4E4418BBE044000FCFC9 /* WKScrollView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WKScrollView.h; path = ios/WKScrollView.h; sourceTree = "<group>"; };
 		0FCB4E4518BBE044000FCFC9 /* WKScrollView.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = WKScrollView.mm; path = ios/WKScrollView.mm; sourceTree = "<group>"; };
-		0FCB4E5618BBE3D9000FCFC9 /* FindIndicatorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicatorWindow.h; sourceTree = "<group>"; };
-		0FCB4E5718BBE3D9000FCFC9 /* FindIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FindIndicatorWindow.mm; sourceTree = "<group>"; };
+		0FCB4E5618BBE3D9000FCFC9 /* TextIndicatorWindow.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextIndicatorWindow.h; sourceTree = "<group>"; };
+		0FCB4E5718BBE3D9000FCFC9 /* TextIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextIndicatorWindow.mm; sourceTree = "<group>"; };
 		0FCB4E5818BBE3D9000FCFC9 /* PageClientImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageClientImpl.h; sourceTree = "<group>"; };
 		0FCB4E5918BBE3D9000FCFC9 /* PageClientImpl.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PageClientImpl.mm; sourceTree = "<group>"; };
 		0FCB4E5C18BBE3D9000FCFC9 /* WKPrintingView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKPrintingView.h; sourceTree = "<group>"; };
@@ -2276,8 +2276,8 @@
 		1A90C1ED1264FD50003E44D4 /* WebFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFindOptions.h; sourceTree = "<group>"; };
 		1A90C1F21264FD71003E44D4 /* FindController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindController.h; sourceTree = "<group>"; };
 		1A90C1F31264FD71003E44D4 /* FindController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindController.cpp; sourceTree = "<group>"; };
-		1A91006F126675C3001842F5 /* FindIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindIndicator.h; sourceTree = "<group>"; };
-		1A910070126675C4001842F5 /* FindIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FindIndicator.cpp; sourceTree = "<group>"; };
+		1A91006F126675C3001842F5 /* TextIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextIndicator.h; sourceTree = "<group>"; };
+		1A910070126675C4001842F5 /* TextIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextIndicator.cpp; sourceTree = "<group>"; };
 		1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeContext.h; sourceTree = "<group>"; };
 		1A92DC1212F8BAB90017AF65 /* LayerTreeContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = LayerTreeContext.cpp; sourceTree = "<group>"; };
 		1A9E32871821636900F5D04C /* _WKRemoteObjectRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _WKRemoteObjectRegistry.h; sourceTree = "<group>"; };
@@ -5778,10 +5778,10 @@
 				BC2652121182608100243E12 /* DrawingAreaProxy.cpp */,
 				BC2652131182608100243E12 /* DrawingAreaProxy.h */,
 				1A6422FC12DD08FE00CAAE2C /* DrawingAreaProxy.messages.in */,
-				1A910070126675C4001842F5 /* FindIndicator.cpp */,
+				1A910070126675C4001842F5 /* TextIndicator.cpp */,
 				1AE00D5E1831792100087DD7 /* FrameLoadState.cpp */,
 				1AE00D5F1831792100087DD7 /* FrameLoadState.h */,
-				1A91006F126675C3001842F5 /* FindIndicator.h */,
+				1A91006F126675C3001842F5 /* TextIndicator.h */,
 				BC17753E118BABF0007D9E9A /* GenericCallback.h */,
 				BC06F44912DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.cpp */,
 				BC06F44812DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.h */,
@@ -6584,8 +6584,8 @@
 			children = (
 				B878B613133428DC006888E9 /* CorrectionPanel.h */,
 				B878B614133428DC006888E9 /* CorrectionPanel.mm */,
-				0FCB4E5618BBE3D9000FCFC9 /* FindIndicatorWindow.h */,
-				0FCB4E5718BBE3D9000FCFC9 /* FindIndicatorWindow.mm */,
+				0FCB4E5618BBE3D9000FCFC9 /* TextIndicatorWindow.h */,
+				0FCB4E5718BBE3D9000FCFC9 /* TextIndicatorWindow.mm */,
 				1AFDE65B1954E8D500C48FFA /* LegacySessionStateCoding.cpp */,
 				0FCB4E5818BBE3D9000FCFC9 /* PageClientImpl.h */,
 				0FCB4E5918BBE3D9000FCFC9 /* PageClientImpl.mm */,
@@ -7163,7 +7163,7 @@
 				1A7C6CDB1378950800B9C04D /* EnvironmentVariables.h in Headers */,
 				1AA575FB1496B52600A4EE06 /* EventDispatcher.h in Headers */,
 				1A90C1F41264FD71003E44D4 /* FindController.h in Headers */,
-				1A910071126675C4001842F5 /* FindIndicator.h in Headers */,
+				1A910071126675C4001842F5 /* TextIndicator.h in Headers */,
 				515E7728183DD6F60007203F /* AsyncRequest.h in Headers */,
 				BCE81D8D1319F7EF00241910 /* FontInfo.h in Headers */,
 				1ABC3DFC1899F51C004F0626 /* WKNavigationDelegate.h in Headers */,
@@ -7211,7 +7211,7 @@
 				51654EFE184EF33F007DC837 /* UniqueIDBDatabaseBackingStoreSQLite.h in Headers */,
 				BC33E0D112408E8600360F3F /* InjectedBundleRangeHandle.h in Headers */,
 				A115DC72191D82DA00DA8072 /* _WKWebViewPrintFormatter.h in Headers */,
-				0FCB4E6018BBE3D9000FCFC9 /* FindIndicatorWindow.h in Headers */,
+				0FCB4E6018BBE3D9000FCFC9 /* TextIndicatorWindow.h in Headers */,
 				BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
 				BCB0B0DE12305A8C00B1341E /* InjectedBundleUserMessageCoders.h in Headers */,
 				1AE49A4911FFA8CE0048B464 /* JSNPMethod.h in Headers */,
@@ -8819,7 +8819,7 @@
 				1AA576021496B97900A4EE06 /* EventDispatcherMessageReceiver.cpp in Sources */,
 				1A1E093318861D3800D2DC49 /* WebProgressTrackerClient.cpp in Sources */,
 				1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */,
-				1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */,
+				1A910072126675C4001842F5 /* TextIndicator.cpp in Sources */,
 				BCE81D8C1319F7EF00241910 /* FontInfo.cpp in Sources */,
 				378E1A4918208CD60031007A /* WKNSString.mm in Sources */,
 				1AAF08B719269E6D00B6390C /* WebUserContentControllerMessageReceiver.cpp in Sources */,
@@ -9318,7 +9318,7 @@
 				BCBAAC72144E61990053F82F /* WKBrowsingContextController.mm in Sources */,
 				BCBAACF51452324F0053F82F /* WKBrowsingContextGroup.mm in Sources */,
 				51290992183ACEAF005522A6 /* WebIDBServerConnection.cpp in Sources */,
-				0FCB4E6118BBE3D9000FCFC9 /* FindIndicatorWindow.mm in Sources */,
+				0FCB4E6118BBE3D9000FCFC9 /* TextIndicatorWindow.mm in Sources */,
 				BC204EEE11C83EC8008F3375 /* WKBundle.cpp in Sources */,
 				7C6E70FB18B2DC7A00F24E2E /* WebProcessCocoa.mm in Sources */,
 				935EEB9E127761AC003322B8 /* WKBundleBackForwardList.cpp in Sources */,

Modified: trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp (175475 => 175476)


--- trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp	2014-11-03 18:39:08 UTC (rev 175475)
+++ trunk/Source/WebKit2/WebProcess/WebPage/FindController.cpp	2014-11-03 19:17:20 UTC (rev 175476)
@@ -368,7 +368,7 @@
         textRectsInSelectionRectCoordinates.append(textRectInSelectionRectCoordinates);
     }            
 
-    m_webPage->send(Messages::WebPageProxy::SetFindIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, m_webPage->corePage()->deviceScaleFactor(), handle, !isShowingOverlay, shouldAnimate));
+    m_webPage->send(Messages::WebPageProxy::SetTextIndicator(selectionRectInWindowCoordinates, textRectsInSelectionRectCoordinates, m_webPage->corePage()->deviceScaleFactor(), handle, !isShowingOverlay, shouldAnimate));
     m_findIndicatorRect = selectionRectInWindowCoordinates;
     m_isShowingFindIndicator = true;
 
@@ -381,7 +381,7 @@
         return;
 
     ShareableBitmap::Handle handle;
-    m_webPage->send(Messages::WebPageProxy::SetFindIndicator(FloatRect(), Vector<FloatRect>(), m_webPage->corePage()->deviceScaleFactor(), handle, false, true));
+    m_webPage->send(Messages::WebPageProxy::SetTextIndicator(FloatRect(), Vector<FloatRect>(), m_webPage->corePage()->deviceScaleFactor(), handle, false, true));
     m_isShowingFindIndicator = false;
     m_foundStringMatchIndex = -1;
     didHideFindIndicator();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to