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 "chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h" | 5 #include "chrome/browser/renderer_host/pepper/pepper_flash_browser_host.h" |
6 | 6 |
7 #include "base/time/time.h" | 7 #include "base/time/time.h" |
8 #include "chrome/browser/content_settings/cookie_settings.h" | 8 #include "chrome/browser/content_settings/cookie_settings.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "content/public/browser/browser_context.h" | 10 #include "content/public/browser/browser_context.h" |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 weak_factory_(this) { | 57 weak_factory_(this) { |
58 int unused; | 58 int unused; |
59 host->GetRenderFrameIDsForInstance(instance, &render_process_id_, &unused); | 59 host->GetRenderFrameIDsForInstance(instance, &render_process_id_, &unused); |
60 } | 60 } |
61 | 61 |
62 PepperFlashBrowserHost::~PepperFlashBrowserHost() {} | 62 PepperFlashBrowserHost::~PepperFlashBrowserHost() {} |
63 | 63 |
64 int32_t PepperFlashBrowserHost::OnResourceMessageReceived( | 64 int32_t PepperFlashBrowserHost::OnResourceMessageReceived( |
65 const IPC::Message& msg, | 65 const IPC::Message& msg, |
66 ppapi::host::HostMessageContext* context) { | 66 ppapi::host::HostMessageContext* context) { |
67 IPC_BEGIN_MESSAGE_MAP(PepperFlashBrowserHost, msg) | 67 PPAPI_BEGIN_MESSAGE_MAP(PepperFlashBrowserHost, msg) |
68 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Flash_UpdateActivity, | 68 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0(PpapiHostMsg_Flash_UpdateActivity, |
69 OnUpdateActivity); | 69 OnUpdateActivity) |
70 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_GetLocalTimeZoneOffset, | 70 PPAPI_DISPATCH_HOST_RESOURCE_CALL(PpapiHostMsg_Flash_GetLocalTimeZoneOffset, |
71 OnGetLocalTimeZoneOffset); | 71 OnGetLocalTimeZoneOffset) |
72 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0( | 72 PPAPI_DISPATCH_HOST_RESOURCE_CALL_0( |
73 PpapiHostMsg_Flash_GetLocalDataRestrictions, OnGetLocalDataRestrictions); | 73 PpapiHostMsg_Flash_GetLocalDataRestrictions, OnGetLocalDataRestrictions) |
74 IPC_END_MESSAGE_MAP() | 74 PPAPI_END_MESSAGE_MAP() |
75 return PP_ERROR_FAILED; | 75 return PP_ERROR_FAILED; |
76 } | 76 } |
77 | 77 |
78 int32_t PepperFlashBrowserHost::OnUpdateActivity( | 78 int32_t PepperFlashBrowserHost::OnUpdateActivity( |
79 ppapi::host::HostMessageContext* host_context) { | 79 ppapi::host::HostMessageContext* host_context) { |
80 #if defined(OS_WIN) | 80 #if defined(OS_WIN) |
81 // Reading then writing back the same value to the screensaver timeout system | 81 // Reading then writing back the same value to the screensaver timeout system |
82 // setting resets the countdown which prevents the screensaver from turning | 82 // setting resets the countdown which prevents the screensaver from turning |
83 // on "for a while". As long as the plugin pings us with this message faster | 83 // on "for a while". As long as the plugin pings us with this message faster |
84 // than the screensaver timeout, it won't go on. | 84 // than the screensaver timeout, it won't go on. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 restrictions = PP_FLASHLSORESTRICTIONS_BLOCK; | 154 restrictions = PP_FLASHLSORESTRICTIONS_BLOCK; |
155 else if (cookie_settings_->IsCookieSessionOnly(plugin_url)) | 155 else if (cookie_settings_->IsCookieSessionOnly(plugin_url)) |
156 restrictions = PP_FLASHLSORESTRICTIONS_IN_MEMORY; | 156 restrictions = PP_FLASHLSORESTRICTIONS_IN_MEMORY; |
157 } | 157 } |
158 SendReply(reply_context, | 158 SendReply(reply_context, |
159 PpapiPluginMsg_Flash_GetLocalDataRestrictionsReply( | 159 PpapiPluginMsg_Flash_GetLocalDataRestrictionsReply( |
160 static_cast<int32_t>(restrictions))); | 160 static_cast<int32_t>(restrictions))); |
161 } | 161 } |
162 | 162 |
163 } // namespace chrome | 163 } // namespace chrome |
OLD | NEW |