| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/chrome_render_frame_observer.h" | 5 #include "chrome/renderer/chrome_render_frame_observer.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 if (handled) | 93 if (handled) |
| 94 return false; | 94 return false; |
| 95 | 95 |
| 96 IPC_BEGIN_MESSAGE_MAP(ChromeRenderFrameObserver, message) | 96 IPC_BEGIN_MESSAGE_MAP(ChromeRenderFrameObserver, message) |
| 97 IPC_MESSAGE_HANDLER(ChromeViewMsg_RequestThumbnailForContextNode, | 97 IPC_MESSAGE_HANDLER(ChromeViewMsg_RequestThumbnailForContextNode, |
| 98 OnRequestThumbnailForContextNode) | 98 OnRequestThumbnailForContextNode) |
| 99 IPC_MESSAGE_HANDLER(PrintMsg_PrintNodeUnderContextMenu, | 99 IPC_MESSAGE_HANDLER(PrintMsg_PrintNodeUnderContextMenu, |
| 100 OnPrintNodeUnderContextMenu) | 100 OnPrintNodeUnderContextMenu) |
| 101 IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerPromptRequest, | 101 IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerPromptRequest, |
| 102 OnAppBannerPromptRequest) | 102 OnAppBannerPromptRequest) |
| 103 IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerDebugMessageRequest, |
| 104 OnAppBannerDebugMessageRequest) |
| 103 IPC_MESSAGE_UNHANDLED(handled = false) | 105 IPC_MESSAGE_UNHANDLED(handled = false) |
| 104 IPC_END_MESSAGE_MAP() | 106 IPC_END_MESSAGE_MAP() |
| 105 | 107 |
| 106 return handled; | 108 return handled; |
| 107 } | 109 } |
| 108 | 110 |
| 109 void ChromeRenderFrameObserver::OnSetIsPrerendering(bool is_prerendering) { | 111 void ChromeRenderFrameObserver::OnSetIsPrerendering(bool is_prerendering) { |
| 110 if (is_prerendering) { | 112 if (is_prerendering) { |
| 111 // If the PrerenderHelper for this frame already exists, don't create it. It | 113 // If the PrerenderHelper for this frame already exists, don't create it. It |
| 112 // can already be created for subframes during handling of | 114 // can already be created for subframes during handling of |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 int request_id, const std::string& platform) { | 200 int request_id, const std::string& platform) { |
| 199 blink::WebAppBannerPromptReply reply = blink::WebAppBannerPromptReply::None; | 201 blink::WebAppBannerPromptReply reply = blink::WebAppBannerPromptReply::None; |
| 200 blink::WebString web_platform(base::UTF8ToUTF16(platform)); | 202 blink::WebString web_platform(base::UTF8ToUTF16(platform)); |
| 201 blink::WebVector<blink::WebString> web_platforms(&web_platform, 1); | 203 blink::WebVector<blink::WebString> web_platforms(&web_platform, 1); |
| 202 render_frame()->GetWebFrame()->willShowInstallBannerPrompt( | 204 render_frame()->GetWebFrame()->willShowInstallBannerPrompt( |
| 203 web_platforms, &reply); | 205 web_platforms, &reply); |
| 204 | 206 |
| 205 Send(new ChromeViewHostMsg_AppBannerPromptReply( | 207 Send(new ChromeViewHostMsg_AppBannerPromptReply( |
| 206 routing_id(), request_id, reply)); | 208 routing_id(), request_id, reply)); |
| 207 } | 209 } |
| 210 |
| 211 void ChromeRenderFrameObserver::OnAppBannerDebugMessageRequest( |
| 212 const std::string& message) { |
| 213 render_frame()->GetWebFrame()->addMessageToConsole(blink::WebConsoleMessage( |
| 214 blink::WebConsoleMessage::LevelDebug, base::UTF8ToUTF16(message))); |
| 215 } |
| OLD | NEW |