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

Unified Diff: chrome/browser/ui/views/link_disambiguation/link_disambiguation_popup.h

Issue 351683002: Adds link disambiguation popup support to Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: first patch ready for review Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/link_disambiguation/link_disambiguation_popup.h
diff --git a/chrome/browser/ui/views/link_disambiguation/link_disambiguation_popup.h b/chrome/browser/ui/views/link_disambiguation/link_disambiguation_popup.h
new file mode 100644
index 0000000000000000000000000000000000000000..510dd4413f7efa02f8e6bcdd9440c6748e8e24a5
--- /dev/null
+++ b/chrome/browser/ui/views/link_disambiguation/link_disambiguation_popup.h
@@ -0,0 +1,45 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_VIEWS_LINK_DISAMBIGUATION_LINK_DISAMBIGUATION_POPUP_H_
+#define CHROME_BROWSER_UI_VIEWS_LINK_DISAMBIGUATION_LINK_DISAMBIGUATION_POPUP_H_
+
+#include "base/callback_forward.h"
+#include "content/public/browser/web_contents_view_delegate.h"
+#include "ui/gfx/geometry/rect.h"
+#include "ui/gfx/image/image.h"
+
+namespace aura {
+class Window;
+}
+
+// Creates a popup with a zoomed bitmap rendered by Blink of an area in web
+// |content| that received an ambiguous Gesture event. This allows the user to
+// select which of the links their first Gesture event overlapped. The popup
+// generates a new Gesture event which is sent back to the provided |callback|.
+class LinkDisambiguationPopup {
+ public:
+ explicit LinkDisambiguationPopup();
+ ~LinkDisambiguationPopup();
+
+ void SetBitmap(const SkBitmap& zoomed_bitmap);
+ void Show(const gfx::Rect& target_rect,
+ const gfx::NativeView content,
+ content::WebContentsViewDelegate::GestureCallback callback);
+ void Close();
+
+ private:
+ class ZoomBubbleView;
+
+ // It is possible that |view_| can be destroyed by its widget instead of
+ // closed explicitly by us. In that case we need to be notified that it has
+ // been destroyed so we can invalidate our own pointer to that view.
+ void InvalidateBubbleView();
+
+ const aura::Window* content_;
+ ZoomBubbleView* view_;
+ gfx::Image zoomed_image_;
+};
+
+#endif // CHROME_BROWSER_UI_VIEWS_LINK_DISAMBIGUATION_LINK_DISAMBIGUATION_POPUP_H_

Powered by Google App Engine
This is Rietveld 408576698