summaryrefslogtreecommitdiffstats
path: root/content/public/renderer/render_view_observer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'content/public/renderer/render_view_observer.cc')
-rw-r--r--content/public/renderer/render_view_observer.cc21
1 files changed, 18 insertions, 3 deletions
diff --git a/content/public/renderer/render_view_observer.cc b/content/public/renderer/render_view_observer.cc
index 6668990..980985c 100644
--- a/content/public/renderer/render_view_observer.cc
+++ b/content/public/renderer/render_view_observer.cc
@@ -8,14 +8,21 @@
using WebKit::WebFrame;
+// TODO(jam): temporary until RenderView is renamed to RenderViewImpl since
+// trying ::RenderView* below gives compile errors in gcc.
+typedef RenderView RenderViewImpl;
+
namespace content {
RenderViewObserver::RenderViewObserver(RenderView* render_view)
- : render_view_(render_view),
- routing_id_(render_view ? render_view->routing_id() : MSG_ROUTING_NONE) {
+ : render_view_(NULL),
+ routing_id_(MSG_ROUTING_NONE) {
// |render_view| can be NULL on unit testing.
- if (render_view_)
+ if (render_view) {
+ render_view_ = static_cast<RenderViewImpl*>(render_view);
+ routing_id_ = render_view_->routing_id();
render_view_->AddObserver(this);
+ }
}
RenderViewObserver::~RenderViewObserver() {
@@ -39,4 +46,12 @@ bool RenderViewObserver::Send(IPC::Message* message) {
return false;
}
+RenderView* RenderViewObserver::render_view() {
+ return render_view_;
+}
+
+void RenderViewObserver::set_render_view(::RenderView* rv) {
+ render_view_ = rv;
+}
+
} // namespace content