| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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 "chrome/browser/prerender/prerender_render_view_host_observer.h" | 5 #include "chrome/browser/prerender/prerender_render_view_host_observer.h" |
| 6 | 6 |
| 7 #include "chrome/browser/prerender/prerender_contents.h" | 7 #include "chrome/browser/prerender/prerender_contents.h" |
| 8 #include "chrome/common/icon_messages.h" | 8 #include "chrome/common/icon_messages.h" |
| 9 #include "chrome/common/render_messages.h" | 9 #include "chrome/common/render_messages.h" |
| 10 #include "content/common/view_messages.h" | 10 #include "content/common/view_messages.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 // If this was a DidStartProvisionalLoadForFrame message, we don't want to | 40 // If this was a DidStartProvisionalLoadForFrame message, we don't want to |
| 41 // to consume it, so return false; | 41 // to consume it, so return false; |
| 42 if (handled) | 42 if (handled) |
| 43 return false; | 43 return false; |
| 44 | 44 |
| 45 // The following messages we do want to consume. | 45 // The following messages we do want to consume. |
| 46 handled = true; | 46 handled = true; |
| 47 IPC_BEGIN_MESSAGE_MAP(PrerenderRenderViewHostObserver, message) | 47 IPC_BEGIN_MESSAGE_MAP(PrerenderRenderViewHostObserver, message) |
| 48 IPC_MESSAGE_HANDLER(IconHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) | 48 IPC_MESSAGE_HANDLER(IconHostMsg_UpdateFaviconURL, OnUpdateFaviconURL) |
| 49 IPC_MESSAGE_HANDLER(ViewHostMsg_MaybeCancelPrerenderForHTML5Media, | 49 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_MaybeCancelPrerenderForHTML5Media, |
| 50 OnMaybeCancelPrerenderForHTML5Media) | 50 OnMaybeCancelPrerenderForHTML5Media) |
| 51 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) | 51 IPC_MESSAGE_HANDLER(ViewHostMsg_JSOutOfMemory, OnJSOutOfMemory) |
| 52 IPC_MESSAGE_HANDLER(ViewHostMsg_RunJavaScriptMessage, | 52 IPC_MESSAGE_HANDLER(ViewHostMsg_RunJavaScriptMessage, |
| 53 OnRunJavaScriptMessage) | 53 OnRunJavaScriptMessage) |
| 54 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) | 54 IPC_MESSAGE_HANDLER(ViewHostMsg_RenderViewGone, OnRenderViewGone) |
| 55 IPC_MESSAGE_HANDLER(ViewHostMsg_CancelPrerenderForPrinting, | 55 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_CancelPrerenderForPrinting, |
| 56 OnCancelPrerenderForPrinting) | 56 OnCancelPrerenderForPrinting) |
| 57 IPC_MESSAGE_UNHANDLED(handled = false) | 57 IPC_MESSAGE_UNHANDLED(handled = false) |
| 58 IPC_END_MESSAGE_MAP() | 58 IPC_END_MESSAGE_MAP() |
| 59 | 59 |
| 60 // Pass the message through. | 60 // Pass the message through. |
| 61 if (!handled) | 61 if (!handled) |
| 62 handled = RenderViewHostObserver::OnMessageReceived(message); | 62 handled = RenderViewHostObserver::OnMessageReceived(message); |
| 63 | 63 |
| 64 return handled; | 64 return handled; |
| 65 } | 65 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 113 |
| 114 void PrerenderRenderViewHostObserver::OnMaybeCancelPrerenderForHTML5Media() { | 114 void PrerenderRenderViewHostObserver::OnMaybeCancelPrerenderForHTML5Media() { |
| 115 prerender_contents_->Destroy(FINAL_STATUS_HTML5_MEDIA); | 115 prerender_contents_->Destroy(FINAL_STATUS_HTML5_MEDIA); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void PrerenderRenderViewHostObserver::OnCancelPrerenderForPrinting() { | 118 void PrerenderRenderViewHostObserver::OnCancelPrerenderForPrinting() { |
| 119 prerender_contents_->Destroy(FINAL_STATUS_WINDOW_PRINT); | 119 prerender_contents_->Destroy(FINAL_STATUS_WINDOW_PRINT); |
| 120 } | 120 } |
| 121 | 121 |
| 122 } | 122 } |
| OLD | NEW |