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

Side by Side Diff: third_party/WebKit/Source/web/WebLocalFrameImpl.cpp

Issue 1497873002: Make DisplayItemClient an interface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years 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
« no previous file with comments | « third_party/WebKit/Source/web/WebFontImpl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 WebPluginContainerImpl* WebLocalFrameImpl::pluginContainerFromNode(LocalFrame* f rame, const WebNode& node) 328 WebPluginContainerImpl* WebLocalFrameImpl::pluginContainerFromNode(LocalFrame* f rame, const WebNode& node)
329 { 329 {
330 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame); 330 WebPluginContainerImpl* pluginContainer = pluginContainerFromFrame(frame);
331 if (pluginContainer) 331 if (pluginContainer)
332 return pluginContainer; 332 return pluginContainer;
333 return toWebPluginContainerImpl(node.pluginContainer()); 333 return toWebPluginContainerImpl(node.pluginContainer());
334 } 334 }
335 335
336 // Simple class to override some of PrintContext behavior. Some of the methods 336 // Simple class to override some of PrintContext behavior. Some of the methods
337 // made virtual so that they can be overridden by ChromePluginPrintContext. 337 // made virtual so that they can be overridden by ChromePluginPrintContext.
338 class ChromePrintContext : public PrintContext { 338 class ChromePrintContext : public PrintContext, public DisplayItemClient {
339 WTF_MAKE_NONCOPYABLE(ChromePrintContext); 339 WTF_MAKE_NONCOPYABLE(ChromePrintContext);
340 public: 340 public:
341 ChromePrintContext(LocalFrame* frame) 341 ChromePrintContext(LocalFrame* frame)
342 : PrintContext(frame) 342 : PrintContext(frame)
343 , m_printedPageWidth(0) 343 , m_printedPageWidth(0)
344 { 344 {
345 } 345 }
346 346
347 ~ChromePrintContext() override {} 347 ~ChromePrintContext() override {}
348 348
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 #endif 431 #endif
432 TransformRecorder transformRecorder(context, *this, transform); 432 TransformRecorder transformRecorder(context, *this, transform);
433 spoolPage(context, pageIndex); 433 spoolPage(context, pageIndex);
434 434
435 currentHeight += pageSizeInPixels.height() + 1; 435 currentHeight += pageSizeInPixels.height() + 1;
436 } 436 }
437 pictureBuilder.endRecording()->playback(canvas); 437 pictureBuilder.endRecording()->playback(canvas);
438 outputLinkedDestinations(canvas, allPagesRect); 438 outputLinkedDestinations(canvas, allPagesRect);
439 } 439 }
440 440
441 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } 441 String debugName() const final { return "ChromePrintContext"; }
442
443 String debugName() const { return "ChromePrintContext"; }
444 442
445 protected: 443 protected:
446 // Spools the printed page, a subrect of frame(). Skip the scale step. 444 // Spools the printed page, a subrect of frame(). Skip the scale step.
447 // NativeTheme doesn't play well with scaling. Scaling is done browser side 445 // NativeTheme doesn't play well with scaling. Scaling is done browser side
448 // instead. Returns the scale to be applied. 446 // instead. Returns the scale to be applied.
449 // On Linux, we don't have the problem with NativeTheme, hence we let WebKit 447 // On Linux, we don't have the problem with NativeTheme, hence we let WebKit
450 // do the scaling and ignore the return value. 448 // do the scaling and ignore the return value.
451 virtual float spoolPage(GraphicsContext& context, int pageNumber) 449 virtual float spoolPage(GraphicsContext& context, int pageNumber)
452 { 450 {
453 IntRect pageRect = m_pageRects[pageNumber]; 451 IntRect pageRect = m_pageRects[pageNumber];
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after
2247 } 2245 }
2248 2246
2249 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const 2247 WebSandboxFlags WebLocalFrameImpl::effectiveSandboxFlags() const
2250 { 2248 {
2251 if (!frame()) 2249 if (!frame())
2252 return WebSandboxFlags::None; 2250 return WebSandboxFlags::None;
2253 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( )); 2251 return static_cast<WebSandboxFlags>(frame()->loader().effectiveSandboxFlags( ));
2254 } 2252 }
2255 2253
2256 } // namespace blink 2254 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebFontImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698