| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/public/browser/web_contents_observer.h" | 5 #include "content/public/browser/web_contents_observer.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/render_view_host_impl.h" | 7 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 8 #include "content/browser/web_contents/web_contents_impl.h" | 8 #include "content/browser/web_contents/web_contents_impl.h" |
| 9 #include "content/public/browser/navigation_details.h" | 9 #include "content/public/browser/navigation_details.h" |
| 10 | 10 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 web_contents_->GetRenderViewHost())->Send(message); | 51 web_contents_->GetRenderViewHost())->Send(message); |
| 52 } | 52 } |
| 53 | 53 |
| 54 int WebContentsObserver::routing_id() const { | 54 int WebContentsObserver::routing_id() const { |
| 55 if (!web_contents_ || !web_contents_->GetRenderViewHost()) | 55 if (!web_contents_ || !web_contents_->GetRenderViewHost()) |
| 56 return MSG_ROUTING_NONE; | 56 return MSG_ROUTING_NONE; |
| 57 | 57 |
| 58 return web_contents_->GetRenderViewHost()->GetRoutingID(); | 58 return web_contents_->GetRenderViewHost()->GetRoutingID(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void WebContentsObserver::TabContentsDestroyed() { | 61 void WebContentsObserver::WebContentsImplDestroyed() { |
| 62 // Do cleanup so that 'this' can safely be deleted from WebContentsDestroyed. | 62 // Do cleanup so that 'this' can safely be deleted from WebContentsDestroyed. |
| 63 web_contents_->RemoveObserver(this); | 63 web_contents_->RemoveObserver(this); |
| 64 WebContentsImpl* contents = web_contents_; | 64 WebContentsImpl* contents = web_contents_; |
| 65 web_contents_ = NULL; | 65 web_contents_ = NULL; |
| 66 WebContentsDestroyed(contents); | 66 WebContentsDestroyed(contents); |
| 67 } | 67 } |
| 68 | 68 |
| 69 } // namespace content | 69 } // namespace content |
| OLD | NEW |