OLD | NEW |
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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 #if __OBJC__ | 37 #if __OBJC__ |
38 @class NSAttributedString; | 38 @class NSAttributedString; |
39 #else | 39 #else |
40 class NSAttributedString; | 40 class NSAttributedString; |
41 #endif | 41 #endif |
42 | 42 |
43 namespace blink { | 43 namespace blink { |
44 | 44 |
45 class WebView; | 45 class WebView; |
| 46 class WebWidget; |
46 struct WebPoint; | 47 struct WebPoint; |
47 | 48 |
48 class WebSubstringUtil { | 49 class WebSubstringUtil { |
49 public: | 50 public: |
| 51 // TODO(ekaramad): This method should only receive a WebWidget. But for the |
| 52 // main frame, WebWidget is in fact a WebViewImpl. Since WebViewImpl has |
| 53 // protected inheritance from WebWidget, we cannot downcast further to get |
| 54 // it from its WebWidget reference. This extra parameter will be removed |
| 55 // once WebViewImpl is no longer a WebWidget. |
50 // Returns an autoreleased NSAttributedString that is the word under | 56 // Returns an autoreleased NSAttributedString that is the word under |
51 // the given point, or nil on error. | 57 // the given point, or nil on error. |
52 // Upon return, |baselinePoint| is set to the left baseline point in | 58 // Upon return, |baselinePoint| is set to the left baseline point in |
53 // AppKit coordinates. | 59 // AppKit coordinates. |
54 BLINK_EXPORT static NSAttributedString* attributedWordAtPoint(WebView*, | 60 BLINK_EXPORT static NSAttributedString* attributedWordAtPoint(WebView*, |
| 61 WebWidget*, |
55 WebPoint, | 62 WebPoint, |
56 WebPoint& baselinePoint); | 63 WebPoint& baselinePoint); |
57 | 64 |
58 // Returns an autoreleased NSAttributedString that is a substring of the | 65 // Returns an autoreleased NSAttributedString that is a substring of the |
59 // Frame at the given range, or nil on error. | 66 // Frame at the given range, or nil on error. |
60 BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebLocalF
rame*, | 67 BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebLocalF
rame*, |
61 size_t location, | 68 size_t location, |
62 size_t length); | 69 size_t length); |
63 | 70 |
64 // Returns an autoreleased NSAttributedString that is a substring of the | 71 // Returns an autoreleased NSAttributedString that is a substring of the |
65 // Frame at the given range, or nil on error. | 72 // Frame at the given range, or nil on error. |
66 // It also gets the baseline point for the given range for showing | 73 // It also gets the baseline point for the given range for showing |
67 // dictionary lookup bubble. | 74 // dictionary lookup bubble. |
68 BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebLocalF
rame*, | 75 BLINK_EXPORT static NSAttributedString* attributedSubstringInRange(WebLocalF
rame*, |
69 size_t location, | 76 size_t location, |
70 size_t length, | 77 size_t length, |
71 WebPoint* baselinePoint); | 78 WebPoint* baselinePoint); |
72 }; | 79 }; |
73 | 80 |
74 } // namespace blink | 81 } // namespace blink |
75 | 82 |
76 #endif | 83 #endif |
OLD | NEW |