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

Unified Diff: ui/views/word_lookup_client.h

Issue 2348143003: MacViews: Implement Force Touch/Mac dictionary lookup for Textfields. (Closed)
Patch Set: Call EnsureLayout in GetDecoratedTextForRange. Created 4 years, 2 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
« ui/views/cocoa/bridged_content_view.mm ('K') | « ui/views/view.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/word_lookup_client.h
diff --git a/ui/views/word_lookup_client.h b/ui/views/word_lookup_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..a099e14e431aaa5b3903859af321b1f06f88af3a
--- /dev/null
+++ b/ui/views/word_lookup_client.h
@@ -0,0 +1,35 @@
+// Copyright 2016 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 UI_VIEWS_WORD_LOOKUP_CLIENT_H_
+#define UI_VIEWS_WORD_LOOKUP_CLIENT_H_
+
+#include "ui/views/views_export.h"
+
+namespace gfx {
+struct DecoratedText;
+class Point;
+} // namespace gfx
tapted 2016/10/05 06:20:55 nit: comments aren't usually put at the end of nam
karandeepb 2016/10/06 01:07:05 Done.
+
+namespace views {
+
+// An interface implemented by a view which supports word lookups.
+class VIEWS_EXPORT WordLookupClient {
+ public:
+ // Retrieves the word displayed at the given |point| along with its styling
+ // information. |point| is in the coordinate system of the view. If no word is
+ // displayed at the point, returns a nearby word. |baseline_point| should
+ // correspond to the baseline point of the leftmost glyph of the |word| in the
+ // view's coordinates. Returns false, if no word can be retrieved.
+ virtual bool GetDecoratedWordAtPoint(const gfx::Point& point,
+ gfx::DecoratedText* decorated_word,
+ gfx::Point* baseline_point) = 0;
+
+ protected:
+ ~WordLookupClient() {}
tapted 2016/10/05 06:20:55 declare virtual? (or can it be omitted whilst ther
sky 2016/10/05 16:15:36 Generally we declare the destructor in pure virtua
karandeepb 2016/10/06 01:07:05 Declared virtual. I think if we omit the destructo
karandeepb 2016/10/06 01:07:05 Done.
tapted 2016/10/06 02:03:19 Hypothetically, I think a future subclass we don't
karandeepb 2016/10/06 02:23:02 Makes sense, thanks!
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_WORD_LOOKUP_CLIENT_H_
« ui/views/cocoa/bridged_content_view.mm ('K') | « ui/views/view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698