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

Side by Side Diff: third_party/WebKit/public/web/mac/WebSubstringUtil.h

Issue 2278283002: Implement Mac Pop-up Dictionary for OOPIF. (Closed)
Patch Set: Rebased Created 4 years, 3 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 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 14 matching lines...) Expand all
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebSubstringUtil_h 31 #ifndef WebSubstringUtil_h
32 #define WebSubstringUtil_h 32 #define WebSubstringUtil_h
33 33
34 #include "../../platform/WebCommon.h" 34 #include "../../platform/WebCommon.h"
35 #include "public/web/WebFrame.h"
36 35
37 #if __OBJC__ 36 #if __OBJC__
38 @class NSAttributedString; 37 @class NSAttributedString;
39 #else 38 #else
40 class NSAttributedString; 39 class NSAttributedString;
41 #endif 40 #endif
42 41
43 namespace blink { 42 namespace blink {
44 43
45 class WebView; 44 class WebFrameWidget;
45 class WebLocalFrame;
dcheng 2016/09/21 00:38:34 Nit: remove this, it appears unused.
EhsanK 2016/09/23 15:16:59 Actually, I think they are all needed here since t
46 struct WebPoint; 46 struct WebPoint;
47 47
48 class WebSubstringUtil { 48 class WebSubstringUtil {
49 public: 49 public:
50 // Returns an autoreleased NSAttributedString that is the word under 50 // Returns an autoreleased NSAttributedString that is the word under
51 // the given point, or nil on error. 51 // the given point inside the given WebFrameWidget or nil on error.
52 // Upon return, |baselinePoint| is set to the left baseline point in 52 // Upon return, |baselinePoint| is set to the left baseline point in
53 // AppKit coordinates. 53 // AppKit coordinates.
54 BLINK_EXPORT static NSAttributedString* attributedWordAtPoint(WebView*, 54 BLINK_EXPORT static NSAttributedString* attributedWordAtPoint(
55 WebFrameWidget*,
55 WebPoint, 56 WebPoint,
56 WebPoint& baselinePoint); 57 WebPoint& baselinePoint);
57 58
58 // Returns an autoreleased NSAttributedString that is a substring of the 59 // Returns an autoreleased NSAttributedString that is a substring of the
59 // Frame at the given range, or nil on error. 60 // Frame at the given range, or nil on error.
60 BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebLocalF rame*, 61 BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebLocalF rame*,
61 size_t location, 62 size_t location,
62 size_t length); 63 size_t length);
63 64
64 // Returns an autoreleased NSAttributedString that is a substring of the 65 // Returns an autoreleased NSAttributedString that is a substring of the
65 // Frame at the given range, or nil on error. 66 // Frame at the given range, or nil on error.
66 // It also gets the baseline point for the given range for showing 67 // It also gets the baseline point for the given range for showing
67 // dictionary lookup bubble. 68 // dictionary lookup bubble.
68 BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebLocalF rame*, 69 BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebLocalF rame*,
69 size_t location, 70 size_t location,
70 size_t length, 71 size_t length,
71 WebPoint* baselinePoint); 72 WebPoint* baselinePoint);
72 }; 73 };
73 74
74 } // namespace blink 75 } // namespace blink
75 76
76 #endif 77 #endif
OLDNEW
« content/renderer/render_view_impl.cc ('K') | « third_party/WebKit/Source/web/tests/WebViewTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698