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

Side by Side Diff: Source/core/rendering/RenderWidget.h

Issue 23618022: BrowserPlugin/WebView - Move plugin lifetime to DOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add tests, make plugin creation synchronous. Created 7 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2004, 2005, 2006, 2009, 2010 Apple Inc. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 13 matching lines...) Expand all
24 24
25 #include "core/rendering/RenderReplaced.h" 25 #include "core/rendering/RenderReplaced.h"
26 #include "platform/Widget.h" 26 #include "platform/Widget.h"
27 27
28 namespace WebCore { 28 namespace WebCore {
29 29
30 class RenderWidget : public RenderReplaced { 30 class RenderWidget : public RenderReplaced {
31 public: 31 public:
32 virtual ~RenderWidget(); 32 virtual ~RenderWidget();
33 33
34 Widget* widget() const { return m_widget.get(); } 34 Widget* widget() const;
35 virtual void setWidget(PassRefPtr<Widget>);
36 35
37 void updateWidgetPosition(); 36 void updateWidgetPosition();
38 void widgetPositionsUpdated(); 37 void widgetPositionsUpdated();
39 IntRect windowClipRect() const; 38 IntRect windowClipRect() const;
40 39
41 void setIsOverlapped(bool); 40 void setIsOverlapped(bool);
42 41
43 void ref() { ++m_refCount; } 42 void ref() { ++m_refCount; }
44 void deref(); 43 void deref();
45 44
46 class UpdateSuspendScope { 45 FrameView* frameView() const { return m_frameView; }
47 public: 46
48 UpdateSuspendScope(); 47 virtual bool isWidget() const OVERRIDE FINAL { return true; }
49 ~UpdateSuspendScope(); 48 bool updateWidgetGeometry();
50 };
51 49
52 protected: 50 protected:
53 RenderWidget(Element*); 51 RenderWidget(Element*);
54 52
55 FrameView* frameView() const { return m_frameView; }
56
57 void clearWidget();
58
59 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE FINAL; 53 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle) OV ERRIDE FINAL;
60 virtual void layout(); 54 virtual void layout();
61 virtual void paint(PaintInfo&, const LayoutPoint&); 55 virtual void paint(PaintInfo&, const LayoutPoint&);
62 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const; 56 virtual CursorDirective getCursor(const LayoutPoint&, Cursor&) const;
63 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE; 57 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAct ion) OVERRIDE;
64 58
65 virtual void paintContents(PaintInfo&, const LayoutPoint&); 59 virtual void paintContents(PaintInfo&, const LayoutPoint&);
66 60
67 private: 61 private:
68 virtual bool isWidget() const OVERRIDE FINAL { return true; }
69
70 virtual void willBeDestroyed() OVERRIDE FINAL; 62 virtual void willBeDestroyed() OVERRIDE FINAL;
71 virtual void destroy() OVERRIDE FINAL; 63 virtual void destroy() OVERRIDE FINAL;
72 64
73 bool setWidgetGeometry(const LayoutRect&); 65 bool setWidgetGeometry(const LayoutRect&);
74 bool updateWidgetGeometry();
75 66
76 RefPtr<Widget> m_widget;
77 FrameView* m_frameView; 67 FrameView* m_frameView;
78 IntRect m_clipRect; // The rectangle needs to remain correct after scrolling , so it is stored in content view coordinates, and not clipped to window. 68 IntRect m_clipRect; // The rectangle needs to remain correct after scrolling , so it is stored in content view coordinates, and not clipped to window.
79 int m_refCount; 69 int m_refCount;
80 }; 70 };
81 71
82 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderWidget, isWidget()); 72 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderWidget, isWidget());
83 73
84 } // namespace WebCore 74 } // namespace WebCore
85 75
86 #endif // RenderWidget_h 76 #endif // RenderWidget_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698