| 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/renderer/renderer_webapplicationcachehost_impl.h" | 5 #include "content/renderer/renderer_webapplicationcachehost_impl.h" |
| 6 | 6 |
| 7 #include "content/common/view_messages.h" | 7 #include "content/common/view_messages.h" |
| 8 #include "content/renderer/render_thread_impl.h" | 8 #include "content/renderer/render_thread_impl.h" |
| 9 #include "content/renderer/render_view_impl.h" | 9 #include "content/renderer/render_view_impl.h" |
| 10 #include "third_party/WebKit/public/web/WebFrame.h" | 10 #include "third_party/WebKit/public/web/WebFrame.h" |
| 11 #include "third_party/WebKit/public/web/WebView.h" | 11 #include "third_party/WebKit/public/web/WebView.h" |
| 12 | 12 |
| 13 using appcache::AppCacheBackend; | 13 using appcache::AppCacheBackend; |
| 14 using blink::WebApplicationCacheHostClient; | 14 using blink::WebApplicationCacheHostClient; |
| 15 using blink::WebConsoleMessage; | 15 using blink::WebConsoleMessage; |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 | 18 |
| 19 RendererWebApplicationCacheHostImpl::RendererWebApplicationCacheHostImpl( | 19 RendererWebApplicationCacheHostImpl::RendererWebApplicationCacheHostImpl( |
| 20 RenderViewImpl* render_view, | 20 RenderViewImpl* render_view, |
| 21 WebApplicationCacheHostClient* client, | 21 WebApplicationCacheHostClient* client, |
| 22 AppCacheBackend* backend) | 22 AppCacheBackend* backend) |
| 23 : WebApplicationCacheHostImpl(client, backend), | 23 : WebApplicationCacheHostImpl(client, backend), |
| 24 routing_id_(render_view->routing_id()) { | 24 routing_id_(render_view->routing_id()) { |
| 25 } | 25 } |
| 26 | 26 |
| 27 void RendererWebApplicationCacheHostImpl::OnLogMessage( | 27 void RendererWebApplicationCacheHostImpl::OnLogMessage( |
| 28 appcache::LogLevel log_level, const std::string& message) { | 28 appcache::AppCacheLogLevel log_level, const std::string& message) { |
| 29 if (RenderThreadImpl::current()->layout_test_mode()) | 29 if (RenderThreadImpl::current()->layout_test_mode()) |
| 30 return; | 30 return; |
| 31 | 31 |
| 32 RenderViewImpl* render_view = GetRenderView(); | 32 RenderViewImpl* render_view = GetRenderView(); |
| 33 if (!render_view || !render_view->webview() || | 33 if (!render_view || !render_view->webview() || |
| 34 !render_view->webview()->mainFrame()) | 34 !render_view->webview()->mainFrame()) |
| 35 return; | 35 return; |
| 36 | 36 |
| 37 blink::WebFrame* frame = render_view->webview()->mainFrame(); | 37 blink::WebFrame* frame = render_view->webview()->mainFrame(); |
| 38 frame->addMessageToConsole(WebConsoleMessage( | 38 frame->addMessageToConsole(WebConsoleMessage( |
| (...skipping 14 matching lines...) Expand all Loading... |
| 53 routing_id_, info.manifest_url, false)); | 53 routing_id_, info.manifest_url, false)); |
| 54 } | 54 } |
| 55 WebApplicationCacheHostImpl::OnCacheSelected(info); | 55 WebApplicationCacheHostImpl::OnCacheSelected(info); |
| 56 } | 56 } |
| 57 | 57 |
| 58 RenderViewImpl* RendererWebApplicationCacheHostImpl::GetRenderView() { | 58 RenderViewImpl* RendererWebApplicationCacheHostImpl::GetRenderView() { |
| 59 return RenderViewImpl::FromRoutingID(routing_id_); | 59 return RenderViewImpl::FromRoutingID(routing_id_); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace content | 62 } // namespace content |
| OLD | NEW |