OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "content/renderer/dom_proxy_installer.h" |
| 6 #include "content/renderer/dom_proxy_listener.h" |
| 7 #include "content/renderer/render_view_impl.h" |
| 8 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 DOMProxyInstaller::DOMProxyInstaller(RenderView* render_view, |
| 13 int64 browsing_instance_frame_id) |
| 14 : RenderViewObserver(render_view), |
| 15 dom_proxy_listener_(0), |
| 16 browsing_instance_frame_id_(browsing_instance_frame_id) { |
| 17 } |
| 18 |
| 19 DOMProxyInstaller::~DOMProxyInstaller() { |
| 20 if (dom_proxy_listener_) { |
| 21 delete dom_proxy_listener_; |
| 22 } |
| 23 } |
| 24 |
| 25 void DOMProxyInstaller::DidFinishDocumentLoad(WebKit::WebFrame* frame) |
| 26 { |
| 27 DCHECK(!dom_proxy_listener_); |
| 28 DCHECK_EQ(frame, static_cast<RenderViewImpl*>(render_view())->webview()->mainF
rame()); |
| 29 |
| 30 dom_proxy_listener_ = new DOMProxyListener(frame, |
| 31 browsing_instance_frame_id_); |
| 32 } |
| 33 |
| 34 void DOMProxyInstaller::Navigate(const GURL& url) { |
| 35 // If we navigate this frame, it's no longer a proxy |
| 36 ClosePage(); |
| 37 } |
| 38 |
| 39 void DOMProxyInstaller::ClosePage() { |
| 40 delete this; |
| 41 } |
| 42 |
| 43 } // namespace content |
OLD | NEW |