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

Side by Side Diff: third_party/WebKit/Source/web/PageOverlay.h

Issue 2080623002: Revert "Remove OwnPtr from Blink." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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) 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 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 10 *
(...skipping 15 matching lines...) Expand all
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29 #ifndef PageOverlay_h 29 #ifndef PageOverlay_h
30 #define PageOverlay_h 30 #define PageOverlay_h
31 31
32 #include "platform/graphics/GraphicsLayer.h" 32 #include "platform/graphics/GraphicsLayer.h"
33 #include "platform/graphics/GraphicsLayerClient.h" 33 #include "platform/graphics/GraphicsLayerClient.h"
34 #include "platform/graphics/paint/DisplayItemClient.h" 34 #include "platform/graphics/paint/DisplayItemClient.h"
35 #include "web/WebExport.h" 35 #include "web/WebExport.h"
36 #include "wtf/OwnPtr.h"
37 #include "wtf/PassOwnPtr.h"
36 #include "wtf/text/WTFString.h" 38 #include "wtf/text/WTFString.h"
37 #include <memory>
38 39
39 namespace blink { 40 namespace blink {
40 41
41 class GraphicsContext; 42 class GraphicsContext;
42 class WebPageOverlay; 43 class WebPageOverlay;
43 class WebViewImpl; 44 class WebViewImpl;
44 45
45 // Manages a layer that is overlaid on a WebView's content. 46 // Manages a layer that is overlaid on a WebView's content.
46 // Clients can paint by implementing WebPageOverlay. 47 // Clients can paint by implementing WebPageOverlay.
47 // 48 //
48 // With Slimming Paint, internal clients can extract a GraphicsContext to add 49 // With Slimming Paint, internal clients can extract a GraphicsContext to add
49 // to the PaintController owned by the GraphicsLayer 50 // to the PaintController owned by the GraphicsLayer
50 class WEB_EXPORT PageOverlay : public GraphicsLayerClient, public DisplayItemCli ent { 51 class WEB_EXPORT PageOverlay : public GraphicsLayerClient, public DisplayItemCli ent {
51 public: 52 public:
52 class Delegate : public GarbageCollectedFinalized<Delegate> { 53 class Delegate : public GarbageCollectedFinalized<Delegate> {
53 public: 54 public:
54 DEFINE_INLINE_VIRTUAL_TRACE() { } 55 DEFINE_INLINE_VIRTUAL_TRACE() { }
55 56
56 // Paints page overlay contents. 57 // Paints page overlay contents.
57 virtual void paintPageOverlay(const PageOverlay&, GraphicsContext&, cons t WebSize& webViewSize) const = 0; 58 virtual void paintPageOverlay(const PageOverlay&, GraphicsContext&, cons t WebSize& webViewSize) const = 0;
58 virtual ~Delegate() { } 59 virtual ~Delegate() { }
59 }; 60 };
60 61
61 static std::unique_ptr<PageOverlay> create(WebViewImpl*, PageOverlay::Delega te*); 62 static PassOwnPtr<PageOverlay> create(WebViewImpl*, PageOverlay::Delegate*);
62 63
63 ~PageOverlay(); 64 ~PageOverlay();
64 65
65 void update(); 66 void update();
66 67
67 GraphicsLayer* graphicsLayer() const { return m_layer.get(); } 68 GraphicsLayer* graphicsLayer() const { return m_layer.get(); }
68 69
69 // DisplayItemClient methods. 70 // DisplayItemClient methods.
70 String debugName() const final { return "PageOverlay"; } 71 String debugName() const final { return "PageOverlay"; }
71 LayoutRect visualRect() const override; 72 LayoutRect visualRect() const override;
72 73
73 // GraphicsLayerClient implementation 74 // GraphicsLayerClient implementation
74 bool needsRepaint(const GraphicsLayer&) const { return true; } 75 bool needsRepaint(const GraphicsLayer&) const { return true; }
75 IntRect computeInterestRect(const GraphicsLayer*, const IntRect&) const over ride; 76 IntRect computeInterestRect(const GraphicsLayer*, const IntRect&) const over ride;
76 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain tingPhase, const IntRect& interestRect) const override; 77 void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPain tingPhase, const IntRect& interestRect) const override;
77 String debugName(const GraphicsLayer*) const override; 78 String debugName(const GraphicsLayer*) const override;
78 79
79 private: 80 private:
80 PageOverlay(WebViewImpl*, PageOverlay::Delegate*); 81 PageOverlay(WebViewImpl*, PageOverlay::Delegate*);
81 DISPLAY_ITEM_CACHE_STATUS_UNCACHEABLE_IMPLEMENTATION 82 DISPLAY_ITEM_CACHE_STATUS_UNCACHEABLE_IMPLEMENTATION
82 83
83 WebViewImpl* m_viewImpl; 84 WebViewImpl* m_viewImpl;
84 Persistent<PageOverlay::Delegate> m_delegate; 85 Persistent<PageOverlay::Delegate> m_delegate;
85 std::unique_ptr<GraphicsLayer> m_layer; 86 OwnPtr<GraphicsLayer> m_layer;
86 }; 87 };
87 88
88 } // namespace blink 89 } // namespace blink
89 90
90 #endif // PageOverlay_h 91 #endif // PageOverlay_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/MIDIClientProxy.h ('k') | third_party/WebKit/Source/web/PageOverlay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698