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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // by blink and may not exist when the request is sent. | 203 // by blink and may not exist when the request is sent. |
202 blink::WebAppBannerPromptReply reply = blink::WebAppBannerPromptReply::None; | 204 blink::WebAppBannerPromptReply reply = blink::WebAppBannerPromptReply::None; |
203 blink::WebString web_platform(base::UTF8ToUTF16(platform)); | 205 blink::WebString web_platform(base::UTF8ToUTF16(platform)); |
204 blink::WebVector<blink::WebString> web_platforms(&web_platform, 1); | 206 blink::WebVector<blink::WebString> web_platforms(&web_platform, 1); |
205 render_frame()->GetWebFrame()->willShowInstallBannerPrompt( | 207 render_frame()->GetWebFrame()->willShowInstallBannerPrompt( |
206 request_id, web_platforms, &reply); | 208 request_id, web_platforms, &reply); |
207 | 209 |
208 Send(new ChromeViewHostMsg_AppBannerPromptReply( | 210 Send(new ChromeViewHostMsg_AppBannerPromptReply( |
209 routing_id(), request_id, reply)); | 211 routing_id(), request_id, reply)); |
210 } | 212 } |
| 213 |
| 214 void ChromeRenderFrameObserver::OnAppBannerDebugMessageRequest( |
| 215 const std::string& message) { |
| 216 render_frame()->GetWebFrame()->addMessageToConsole(blink::WebConsoleMessage( |
| 217 blink::WebConsoleMessage::LevelDebug, base::UTF8ToUTF16(message))); |
| 218 } |
OLD | NEW |