OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WEBKIT_GLUE_WEBFRAME_H_ | 5 #ifndef WEBKIT_GLUE_WEBFRAME_H_ |
6 #define WEBKIT_GLUE_WEBFRAME_H_ | 6 #define WEBKIT_GLUE_WEBFRAME_H_ |
7 | 7 |
8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 #include "skia/ext/bitmap_platform_device.h" | 10 #include "skia/ext/bitmap_platform_device.h" |
11 #include "skia/ext/platform_canvas.h" | 11 #include "skia/ext/platform_canvas.h" |
12 #include "webkit/glue/feed.h" | 12 #include "webkit/glue/feed.h" |
13 | 13 |
14 class WebDataSource; | 14 class WebDataSource; |
15 class WebError; | 15 class WebError; |
16 class WebRequest; | 16 class WebRequest; |
17 class WebView; | 17 class WebView; |
18 class WebTextInput; | 18 class WebTextInput; |
19 struct NPObject; | 19 struct NPObject; |
20 | 20 |
21 namespace gfx { | 21 namespace gfx { |
22 class Rect; | 22 class Rect; |
23 class Size; | 23 class Size; |
24 } | 24 } |
25 | 25 |
26 namespace WebKit { | 26 namespace WebKit { |
27 struct WebConsoleMessage; | 27 struct WebConsoleMessage; |
28 struct WebFindInPageRequest; | 28 struct WebFindOptions; |
29 struct WebScriptSource; | 29 struct WebScriptSource; |
30 } | 30 } |
31 | 31 |
32 // Every frame in a web page is represented by one WebFrame, including the | 32 // Every frame in a web page is represented by one WebFrame, including the |
33 // outermost frame. | 33 // outermost frame. |
34 class WebFrame { | 34 class WebFrame { |
35 public: | 35 public: |
36 WebFrame() {} | 36 WebFrame() {} |
37 | 37 |
38 static WebFrame* RetrieveActiveFrame(); | 38 static WebFrame* RetrieveActiveFrame(); |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 // Searches a frame for a given string. | 212 // Searches a frame for a given string. |
213 // | 213 // |
214 // If a match is found, this function will select it (scrolling down to make | 214 // If a match is found, this function will select it (scrolling down to make |
215 // it visible if needed) and fill in the IntRect (selection_rect) with the | 215 // it visible if needed) and fill in the IntRect (selection_rect) with the |
216 // location of where the match was found (in screen coordinates). | 216 // location of where the match was found (in screen coordinates). |
217 // | 217 // |
218 // If no match is found, this function clears all tickmarks and highlighting. | 218 // If no match is found, this function clears all tickmarks and highlighting. |
219 // | 219 // |
220 // Returns true if the search string was found, false otherwise. | 220 // Returns true if the search string was found, false otherwise. |
221 virtual bool Find(const WebKit::WebFindInPageRequest& request, | 221 virtual bool Find(int request_id, |
| 222 const string16& search_text, |
| 223 const WebKit::WebFindOptions& options, |
222 bool wrap_within_frame, | 224 bool wrap_within_frame, |
223 gfx::Rect* selection_rect) = 0; | 225 gfx::Rect* selection_rect) = 0; |
224 | 226 |
225 // Notifies the frame that we are no longer interested in searching. This will | 227 // Notifies the frame that we are no longer interested in searching. This will |
226 // abort any asynchronous scoping effort already under way (see the function | 228 // abort any asynchronous scoping effort already under way (see the function |
227 // ScopeStringMatches for details) and erase all tick-marks and highlighting | 229 // ScopeStringMatches for details) and erase all tick-marks and highlighting |
228 // from the previous search. If |clear_selection| is true, it will also make | 230 // from the previous search. If |clear_selection| is true, it will also make |
229 // sure the end state for the Find operation does not leave a selection. | 231 // sure the end state for the Find operation does not leave a selection. |
230 // This can occur when the user clears the search string but does not close | 232 // This can occur when the user clears the search string but does not close |
231 // the find box. | 233 // the find box. |
232 virtual void StopFinding(bool clear_selection) = 0; | 234 virtual void StopFinding(bool clear_selection) = 0; |
233 | 235 |
234 // Counts how many times a particular string occurs within the frame. It | 236 // Counts how many times a particular string occurs within the frame. It |
235 // also retrieves the location of the string and updates a vector in the frame | 237 // also retrieves the location of the string and updates a vector in the frame |
236 // so that tick-marks and highlighting can be drawn. This function does its | 238 // so that tick-marks and highlighting can be drawn. This function does its |
237 // work asynchronously, by running for a certain time-slice and then | 239 // work asynchronously, by running for a certain time-slice and then |
238 // scheduling itself (co-operative multitasking) to be invoked later | 240 // scheduling itself (co-operative multitasking) to be invoked later |
239 // (repeating the process until all matches have been found). This allows | 241 // (repeating the process until all matches have been found). This allows |
240 // multiple frames to be searched at the same time and provides a way to | 242 // multiple frames to be searched at the same time and provides a way to |
241 // cancel at any time (see CancelPendingScopingEffort). The parameter Request | 243 // cancel at any time (see CancelPendingScopingEffort). The parameter Request |
242 // specifies what to look for and Reset signals whether this is a brand new | 244 // specifies what to look for and Reset signals whether this is a brand new |
243 // request or a continuation of the last scoping effort. | 245 // request or a continuation of the last scoping effort. |
244 virtual void ScopeStringMatches(const WebKit::WebFindInPageRequest& request, | 246 virtual void ScopeStringMatches(int request_id, |
| 247 const string16& search_text, |
| 248 const WebKit::WebFindOptions& options, |
245 bool reset) = 0; | 249 bool reset) = 0; |
246 | 250 |
247 // Cancels any outstanding requests for scoping string matches on a frame. | 251 // Cancels any outstanding requests for scoping string matches on a frame. |
248 virtual void CancelPendingScopingEffort() = 0; | 252 virtual void CancelPendingScopingEffort() = 0; |
249 | 253 |
250 // This function is called on the mainframe during the scoping effort to keep | 254 // This function is called on the mainframe during the scoping effort to keep |
251 // a running tally of the accumulated total match-count for all frames. After | 255 // a running tally of the accumulated total match-count for all frames. After |
252 // updating the count it will notify the render-view about the new count. | 256 // updating the count it will notify the render-view about the new count. |
253 virtual void IncreaseMatchCount(int count, int request_id) = 0; | 257 virtual void IncreaseMatchCount(int count, int request_id) = 0; |
254 | 258 |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 virtual int PendingFrameUnloadEventCount() const = 0; | 387 virtual int PendingFrameUnloadEventCount() const = 0; |
384 | 388 |
385 protected: | 389 protected: |
386 virtual ~WebFrame() {} | 390 virtual ~WebFrame() {} |
387 | 391 |
388 private: | 392 private: |
389 DISALLOW_COPY_AND_ASSIGN(WebFrame); | 393 DISALLOW_COPY_AND_ASSIGN(WebFrame); |
390 }; | 394 }; |
391 | 395 |
392 #endif // WEBKIT_GLUE_WEBFRAME_H_ | 396 #endif // WEBKIT_GLUE_WEBFRAME_H_ |
OLD | NEW |