OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_LINK_DISAMBIGUATION_LINK_DISAMBIGUATION_POPUP_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_LINK_DISAMBIGUATION_LINK_DISAMBIGUATION_POPUP_H_ |
| 7 |
| 8 #include "base/callback_forward.h" |
| 9 #include "content/public/browser/web_contents_view_delegate.h" |
| 10 #include "ui/gfx/geometry/rect.h" |
| 11 #include "ui/gfx/image/image.h" |
| 12 |
| 13 namespace aura { |
| 14 class Window; |
| 15 } |
| 16 |
| 17 // Creates a popup with a zoomed bitmap rendered by Blink of an area in web |
| 18 // |content| that received an ambiguous Gesture event. This allows the user to |
| 19 // select which of the links their first Gesture event overlapped. The popup |
| 20 // generates a new Gesture event which is sent back to the provided |callback|. |
| 21 class LinkDisambiguationPopup { |
| 22 public: |
| 23 explicit LinkDisambiguationPopup(); |
| 24 ~LinkDisambiguationPopup(); |
| 25 |
| 26 void SetBitmap(const SkBitmap& zoomed_bitmap); |
| 27 void Show(const gfx::Rect& target_rect, |
| 28 const gfx::NativeView content, |
| 29 content::WebContentsViewDelegate::GestureCallback callback); |
| 30 void Close(); |
| 31 |
| 32 private: |
| 33 class ZoomBubbleView; |
| 34 |
| 35 // It is possible that |view_| can be destroyed by its widget instead of |
| 36 // closed explicitly by us. In that case we need to be notified that it has |
| 37 // been destroyed so we can invalidate our own pointer to that view. |
| 38 void InvalidateBubbleView(); |
| 39 |
| 40 const aura::Window* content_; |
| 41 ZoomBubbleView* view_; |
| 42 gfx::Image zoomed_image_; |
| 43 }; |
| 44 |
| 45 #endif // CHROME_BROWSER_UI_VIEWS_LINK_DISAMBIGUATION_LINK_DISAMBIGUATION_POPUP
_H_ |
OLD | NEW |