OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 class WebLocalFrame; | 62 class WebLocalFrame; |
63 class WebPerformance; | 63 class WebPerformance; |
64 class WebRemoteFrame; | 64 class WebRemoteFrame; |
65 class WebSecurityOrigin; | 65 class WebSecurityOrigin; |
66 class WebString; | 66 class WebString; |
67 class WebURL; | 67 class WebURL; |
68 class WebURLRequest; | 68 class WebURLRequest; |
69 class WebView; | 69 class WebView; |
70 enum class WebSandboxFlags; | 70 enum class WebSandboxFlags; |
71 struct WebFrameOwnerProperties; | 71 struct WebFrameOwnerProperties; |
72 struct WebPrintParams; | |
73 struct WebRect; | 72 struct WebRect; |
74 struct WebScriptSource; | 73 struct WebScriptSource; |
75 struct WebSize; | 74 struct WebSize; |
76 | 75 |
77 template <typename T> | 76 template <typename T> |
78 class WebVector; | 77 class WebVector; |
79 | 78 |
80 // Frames may be rendered in process ('local') or out of process ('remote'). | 79 // Frames may be rendered in process ('local') or out of process ('remote'). |
81 // A remote frame is always cross-site; a local frame may be either same-site or | 80 // A remote frame is always cross-site; a local frame may be either same-site or |
82 // cross-site. | 81 // cross-site. |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 virtual WebAssociatedURLLoader* CreateAssociatedURLLoader( | 322 virtual WebAssociatedURLLoader* CreateAssociatedURLLoader( |
324 const WebAssociatedURLLoaderOptions&) = 0; | 323 const WebAssociatedURLLoaderOptions&) = 0; |
325 | 324 |
326 // Returns the number of registered unload listeners. | 325 // Returns the number of registered unload listeners. |
327 virtual unsigned UnloadListenerCount() const = 0; | 326 virtual unsigned UnloadListenerCount() const = 0; |
328 | 327 |
329 // Will return true if between didStartLoading and didStopLoading | 328 // Will return true if between didStartLoading and didStopLoading |
330 // notifications. | 329 // notifications. |
331 virtual bool IsLoading() const; | 330 virtual bool IsLoading() const; |
332 | 331 |
333 // Printing ------------------------------------------------------------ | |
334 | |
335 // Reformats the WebFrame for printing. WebPrintParams specifies the printable | |
336 // content size, paper size, printable area size, printer DPI and print | |
337 // scaling option. If constrainToNode node is specified, then only the given | |
338 // node is printed (for now only plugins are supported), instead of the entire | |
339 // frame. | |
340 // Returns the number of pages that can be printed at the given | |
341 // page size. | |
342 virtual int PrintBegin(const WebPrintParams&, | |
343 const WebNode& constrain_to_node = WebNode()) = 0; | |
344 | |
345 // Returns the page shrinking factor calculated by webkit (usually | |
346 // between 1/1.33 and 1/2). Returns 0 if the page number is invalid or | |
347 // not in printing mode. | |
348 virtual float GetPrintPageShrink(int page) = 0; | |
349 | |
350 // Prints one page, and returns the calculated page shrinking factor | |
351 // (usually between 1/1.33 and 1/2). Returns 0 if the page number is | |
352 // invalid or not in printing mode. | |
353 virtual float PrintPage(int page_to_print, WebCanvas*) = 0; | |
354 | |
355 // Reformats the WebFrame for screen display. | |
356 virtual void PrintEnd() = 0; | |
357 | |
358 // If the frame contains a full-frame plugin or the given node refers to a | |
359 // plugin whose content indicates that printed output should not be scaled, | |
360 // return true, otherwise return false. | |
361 virtual bool IsPrintScalingDisabledForPlugin(const WebNode& = WebNode()) = 0; | |
362 | |
363 // Events -------------------------------------------------------------- | 332 // Events -------------------------------------------------------------- |
364 | 333 |
365 // Dispatches a message event on the current DOMWindow in this WebFrame. | 334 // Dispatches a message event on the current DOMWindow in this WebFrame. |
366 virtual void DispatchMessageEventWithOriginCheck( | 335 virtual void DispatchMessageEventWithOriginCheck( |
367 const WebSecurityOrigin& intended_target_origin, | 336 const WebSecurityOrigin& intended_target_origin, |
368 const WebDOMEvent&) = 0; | 337 const WebDOMEvent&) = 0; |
369 | 338 |
370 // Utility ------------------------------------------------------------- | 339 // Utility ------------------------------------------------------------- |
371 | 340 |
372 // Prints all of the pages into the canvas, with page boundaries drawn as | |
373 // one pixel wide blue lines. This method exists to support layout tests. | |
374 virtual void PrintPagesWithBoundaries(WebCanvas*, const WebSize&) = 0; | |
375 | |
376 // Returns the bounds rect for current selection. If selection is performed | |
377 // on transformed text, the rect will still bound the selection but will | |
378 // not be transformed itself. If no selection is present, the rect will be | |
379 // empty ((0,0), (0,0)). | |
380 virtual WebRect SelectionBoundsRect() const = 0; | |
381 | |
382 // Returns the frame inside a given frame or iframe element. Returns 0 if | 341 // Returns the frame inside a given frame or iframe element. Returns 0 if |
383 // the given element is not a frame, iframe or if the frame is empty. | 342 // the given element is not a frame, iframe or if the frame is empty. |
384 BLINK_EXPORT static WebFrame* FromFrameOwnerElement(const WebElement&); | 343 BLINK_EXPORT static WebFrame* FromFrameOwnerElement(const WebElement&); |
385 | 344 |
386 #if BLINK_IMPLEMENTATION | 345 #if BLINK_IMPLEMENTATION |
387 // TODO(mustaq): Should be named FromCoreFrame instead. | 346 // TODO(mustaq): Should be named FromCoreFrame instead. |
388 static WebFrame* FromFrame(Frame*); | 347 static WebFrame* FromFrame(Frame*); |
389 BLINK_EXPORT static Frame* ToCoreFrame(const WebFrame&); | 348 BLINK_EXPORT static Frame* ToCoreFrame(const WebFrame&); |
390 | 349 |
391 bool InShadowTree() const { return scope_ == WebTreeScopeType::kShadow; } | 350 bool InShadowTree() const { return scope_ == WebTreeScopeType::kShadow; } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 WebFrame* first_child_; | 392 WebFrame* first_child_; |
434 WebFrame* last_child_; | 393 WebFrame* last_child_; |
435 | 394 |
436 WebFrame* opener_; | 395 WebFrame* opener_; |
437 std::unique_ptr<OpenedFrameTracker> opened_frame_tracker_; | 396 std::unique_ptr<OpenedFrameTracker> opened_frame_tracker_; |
438 }; | 397 }; |
439 | 398 |
440 } // namespace blink | 399 } // namespace blink |
441 | 400 |
442 #endif | 401 #endif |
OLD | NEW |