Chromium Code Reviews| 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/web_contents/web_contents_impl.h" | 7 #include "content/browser/web_contents/web_contents_impl.h" |
| 8 #include "content/public/browser/navigation_details.h" | 8 #include "content/public/browser/navigation_details.h" |
| 9 #include "content/public/browser/render_view_host.h" | 9 #include "content/public/browser/render_view_host.h" |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 | 53 |
| 54 bool WebContentsObserver::Send(IPC::Message* message) { | 54 bool WebContentsObserver::Send(IPC::Message* message) { |
| 55 if (!web_contents_) { | 55 if (!web_contents_) { |
| 56 delete message; | 56 delete message; |
| 57 return false; | 57 return false; |
| 58 } | 58 } |
| 59 | 59 |
| 60 return web_contents_->Send(message); | 60 return web_contents_->Send(message); |
| 61 } | 61 } |
| 62 | 62 |
| 63 int WebContentsObserver::routing_id() const { | 63 int WebContentsObserver::routing_id() const { |
|
alexmos
2016/11/22 01:29:06
Interesting. This looks like another bad API that
| |
| 64 if (!web_contents_) | 64 if (!web_contents_) |
| 65 return MSG_ROUTING_NONE; | 65 return MSG_ROUTING_NONE; |
| 66 | 66 |
| 67 return web_contents_->GetRoutingID(); | 67 return web_contents_->GetRenderViewHost()->GetRoutingID(); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void WebContentsObserver::ResetWebContents() { | 70 void WebContentsObserver::ResetWebContents() { |
| 71 web_contents_->RemoveObserver(this); | 71 web_contents_->RemoveObserver(this); |
| 72 web_contents_ = nullptr; | 72 web_contents_ = nullptr; |
| 73 } | 73 } |
| 74 | 74 |
| 75 } // namespace content | 75 } // namespace content |
| OLD | NEW |