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

Side by Side Diff: third_party/WebKit/public/web/WebFrame.h

Issue 2923343005: Move printing-related methods from WebFrame to WebLocalFrame. (Closed)
Patch Set: Rebasing... Created 3 years, 6 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) 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
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
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 // Utility ------------------------------------------------------------- 332 // Utility -------------------------------------------------------------
364 333
365 // Prints all of the pages into the canvas, with page boundaries drawn as
366 // one pixel wide blue lines. This method exists to support layout tests.
367 virtual void PrintPagesWithBoundaries(WebCanvas*, const WebSize&) = 0;
368
369 // Returns the bounds rect for current selection. If selection is performed
370 // on transformed text, the rect will still bound the selection but will
371 // not be transformed itself. If no selection is present, the rect will be
372 // empty ((0,0), (0,0)).
373 virtual WebRect SelectionBoundsRect() const = 0;
374
375 // Returns the frame inside a given frame or iframe element. Returns 0 if 334 // Returns the frame inside a given frame or iframe element. Returns 0 if
376 // the given element is not a frame, iframe or if the frame is empty. 335 // the given element is not a frame, iframe or if the frame is empty.
377 static WebFrame* FromFrameOwnerElement(const WebElement&); 336 static WebFrame* FromFrameOwnerElement(const WebElement&);
378 337
379 #if BLINK_IMPLEMENTATION 338 #if BLINK_IMPLEMENTATION
380 // TODO(mustaq): Should be named FromCoreFrame instead. 339 // TODO(mustaq): Should be named FromCoreFrame instead.
381 static WebFrame* FromFrame(Frame*); 340 static WebFrame* FromFrame(Frame*);
382 static Frame* ToCoreFrame(const WebFrame&); 341 static Frame* ToCoreFrame(const WebFrame&);
383 342
384 bool InShadowTree() const { return scope_ == WebTreeScopeType::kShadow; } 343 bool InShadowTree() const { return scope_ == WebTreeScopeType::kShadow; }
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 WebFrame* first_child_; 385 WebFrame* first_child_;
427 WebFrame* last_child_; 386 WebFrame* last_child_;
428 387
429 WebFrame* opener_; 388 WebFrame* opener_;
430 std::unique_ptr<OpenedFrameTracker> opened_frame_tracker_; 389 std::unique_ptr<OpenedFrameTracker> opened_frame_tracker_;
431 }; 390 };
432 391
433 } // namespace blink 392 } // namespace blink
434 393
435 #endif 394 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/tests/WebPluginContainerTest.cpp ('k') | third_party/WebKit/public/web/WebLocalFrame.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698