summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/browser/renderer_host/pepper_message_filter.cc20
-rw-r--r--content/browser/renderer_host/pepper_message_filter.h1
-rw-r--r--ppapi/proxy/ppapi_messages.h1
-rw-r--r--ppapi/proxy/ppb_flash_proxy.cc3
-rw-r--r--webkit/plugins/ppapi/ppb_flash_impl.cc2
5 files changed, 25 insertions, 2 deletions
diff --git a/content/browser/renderer_host/pepper_message_filter.cc b/content/browser/renderer_host/pepper_message_filter.cc
index c43fbc1..a4c4c800 100644
--- a/content/browser/renderer_host/pepper_message_filter.cc
+++ b/content/browser/renderer_host/pepper_message_filter.cc
@@ -15,6 +15,7 @@
#include "base/threading/sequenced_worker_pool.h"
#include "base/threading/worker_pool.h"
#include "base/values.h"
+#include "build/build_config.h"
#include "content/browser/renderer_host/pepper_lookup_request.h"
#include "content/browser/renderer_host/pepper_tcp_server_socket.h"
#include "content/browser/renderer_host/pepper_tcp_socket.h"
@@ -41,6 +42,10 @@
#include "ppapi/shared_impl/private/net_address_private_impl.h"
#include "ppapi/shared_impl/private/ppb_host_resolver_shared.h"
+#ifdef OS_WIN
+#include <windows.h>
+#endif
+
using content::BrowserThread;
using content::RenderViewHostImpl;
using ppapi::NetAddressPrivateImpl;
@@ -144,6 +149,7 @@ bool PepperMessageFilter::OnMessageReceived(const IPC::Message& msg,
OnX509CertificateParseDER);
// Flash messages.
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_UpdateActivity, OnUpdateActivity)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBFlash_GetDeviceID, OnGetDeviceID)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -612,6 +618,20 @@ void PepperMessageFilter::OnX509CertificateParseDER(
result);
}
+void PepperMessageFilter::OnUpdateActivity() {
+#if defined(OS_WIN)
+ // Reading then writing back the same value to the screensaver timeout system
+ // setting resets the countdown which prevents the screensaver from turning
+ // on "for a while". As long as the plugin pings us with this message faster
+ // than the screensaver timeout, it won't go on.
+ int value = 0;
+ if (SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, 0, &value, 0))
+ SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, value, NULL, 0);
+#else
+ // TODO(brettw) implement this for other platforms.
+#endif
+}
+
void PepperMessageFilter::OnGetDeviceID(std::string* id) {
// TODO(brettw) implement this.
*id = "<undefined>";
diff --git a/content/browser/renderer_host/pepper_message_filter.h b/content/browser/renderer_host/pepper_message_filter.h
index ed20ee7..8657793 100644
--- a/content/browser/renderer_host/pepper_message_filter.h
+++ b/content/browser/renderer_host/pepper_message_filter.h
@@ -210,6 +210,7 @@ class PepperMessageFilter
void OnX509CertificateParseDER(const std::vector<char>& der,
bool* succeeded,
ppapi::PPB_X509Certificate_Fields* result);
+ void OnUpdateActivity();
void OnGetDeviceID(std::string* id);
// Callback when the font list has been retrieved on a background thread.
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 43c1331..cf2c2c1 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -1175,6 +1175,7 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBFlash_IsRectTopmost,
PP_Instance /* instance */,
PP_Rect /* rect */,
PP_Bool /* result */)
+IPC_MESSAGE_ROUTED0(PpapiHostMsg_PPBFlash_UpdateActivity)
IPC_SYNC_MESSAGE_ROUTED0_1(PpapiHostMsg_PPBFlash_GetDeviceID,
std::string /* id */)
diff --git a/ppapi/proxy/ppb_flash_proxy.cc b/ppapi/proxy/ppb_flash_proxy.cc
index fc394f3..f61d8b3 100644
--- a/ppapi/proxy/ppb_flash_proxy.cc
+++ b/ppapi/proxy/ppb_flash_proxy.cc
@@ -219,7 +219,8 @@ int32_t InvokePrinting(PP_Instance instance) {
}
void UpdateActivity(PP_Instance instance) {
- // TODO(viettrungluu): Implement me.
+ PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(
+ new PpapiHostMsg_PPBFlash_UpdateActivity(API_ID_PPB_FLASH));
}
PP_Var GetDeviceID(PP_Instance instance) {
diff --git a/webkit/plugins/ppapi/ppb_flash_impl.cc b/webkit/plugins/ppapi/ppb_flash_impl.cc
index b90e52c..da49807 100644
--- a/webkit/plugins/ppapi/ppb_flash_impl.cc
+++ b/webkit/plugins/ppapi/ppb_flash_impl.cc
@@ -263,7 +263,7 @@ int32_t InvokePrinting(PP_Instance pp_instance) {
}
void UpdateActivity(PP_Instance pp_instance) {
- // TODO(viettrungluu): Implement me.
+ // Not supported in-process.
}
PP_Var GetDeviceID(PP_Instance pp_instance) {