| 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 "android_webview/renderer/aw_render_thread_observer.h" | 5 #include "android_webview/renderer/aw_render_thread_observer.h" |
| 6 | 6 |
| 7 #include "android_webview/common/render_view_messages.h" | 7 #include "android_webview/common/render_view_messages.h" |
| 8 #include "ipc/ipc_message_macros.h" | 8 #include "ipc/ipc_message_macros.h" |
| 9 #include "third_party/WebKit/public/platform/WebCache.h" | 9 #include "third_party/WebKit/public/platform/WebCache.h" |
| 10 #include "third_party/WebKit/public/web/WebNetworkStateNotifier.h" | 10 #include "third_party/WebKit/public/platform/WebNetworkStateNotifier.h" |
| 11 | 11 |
| 12 namespace android_webview { | 12 namespace android_webview { |
| 13 | 13 |
| 14 AwRenderThreadObserver::AwRenderThreadObserver() { | 14 AwRenderThreadObserver::AwRenderThreadObserver() { |
| 15 } | 15 } |
| 16 | 16 |
| 17 AwRenderThreadObserver::~AwRenderThreadObserver() { | 17 AwRenderThreadObserver::~AwRenderThreadObserver() { |
| 18 } | 18 } |
| 19 | 19 |
| 20 bool AwRenderThreadObserver::OnControlMessageReceived( | 20 bool AwRenderThreadObserver::OnControlMessageReceived( |
| 21 const IPC::Message& message) { | 21 const IPC::Message& message) { |
| 22 bool handled = true; | 22 bool handled = true; |
| 23 IPC_BEGIN_MESSAGE_MAP(AwRenderThreadObserver, message) | 23 IPC_BEGIN_MESSAGE_MAP(AwRenderThreadObserver, message) |
| 24 IPC_MESSAGE_HANDLER(AwViewMsg_ClearCache, OnClearCache) | 24 IPC_MESSAGE_HANDLER(AwViewMsg_ClearCache, OnClearCache) |
| 25 IPC_MESSAGE_HANDLER(AwViewMsg_SetJsOnlineProperty, OnSetJsOnlineProperty) | 25 IPC_MESSAGE_HANDLER(AwViewMsg_SetJsOnlineProperty, OnSetJsOnlineProperty) |
| 26 IPC_MESSAGE_UNHANDLED(handled = false) | 26 IPC_MESSAGE_UNHANDLED(handled = false) |
| 27 IPC_END_MESSAGE_MAP() | 27 IPC_END_MESSAGE_MAP() |
| 28 return handled; | 28 return handled; |
| 29 } | 29 } |
| 30 | 30 |
| 31 void AwRenderThreadObserver::OnClearCache() { | 31 void AwRenderThreadObserver::OnClearCache() { |
| 32 blink::WebCache::clear(); | 32 blink::WebCache::clear(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void AwRenderThreadObserver::OnSetJsOnlineProperty(bool network_up) { | 35 void AwRenderThreadObserver::OnSetJsOnlineProperty(bool network_up) { |
| 36 blink::WebNetworkStateNotifier::setOnLine(network_up); | 36 blink::WebNetworkStateNotifier::setOnLine(network_up); |
| 37 } | 37 } |
| 38 | 38 |
| 39 } // nanemspace android_webview | 39 } // nanemspace android_webview |
| OLD | NEW |