| 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/pepper/pepper_plugin_instance_impl.h" | 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback_helpers.h" | 8 #include "base/callback_helpers.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 3102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3113 WebString result = container_->executeScriptURL(gurl, false); | 3113 WebString result = container_->executeScriptURL(gurl, false); |
| 3114 return result.isNull() ? PP_ERROR_FAILED : PP_OK; | 3114 return result.isNull() ? PP_ERROR_FAILED : PP_OK; |
| 3115 } | 3115 } |
| 3116 | 3116 |
| 3117 // Only GETs and POSTs are supported. | 3117 // Only GETs and POSTs are supported. |
| 3118 if (web_request.httpMethod() != "GET" && web_request.httpMethod() != "POST") | 3118 if (web_request.httpMethod() != "GET" && web_request.httpMethod() != "POST") |
| 3119 return PP_ERROR_BADARGUMENT; | 3119 return PP_ERROR_BADARGUMENT; |
| 3120 | 3120 |
| 3121 WebString target_str = WebString::fromUTF8(target); | 3121 WebString target_str = WebString::fromUTF8(target); |
| 3122 blink::WebScopedUserGesture user_gesture(CurrentUserGestureToken()); | 3122 blink::WebScopedUserGesture user_gesture(CurrentUserGestureToken()); |
| 3123 container_->loadFrameRequest(web_request, target_str, false, NULL); | 3123 container_->loadFrameRequest(web_request, target_str); |
| 3124 return PP_OK; | 3124 return PP_OK; |
| 3125 } | 3125 } |
| 3126 | 3126 |
| 3127 int PepperPluginInstanceImpl::MakePendingFileRefRendererHost( | 3127 int PepperPluginInstanceImpl::MakePendingFileRefRendererHost( |
| 3128 const base::FilePath& path) { | 3128 const base::FilePath& path) { |
| 3129 RendererPpapiHostImpl* host_impl = module_->renderer_ppapi_host(); | 3129 RendererPpapiHostImpl* host_impl = module_->renderer_ppapi_host(); |
| 3130 PepperFileRefRendererHost* file_ref_host( | 3130 PepperFileRefRendererHost* file_ref_host( |
| 3131 new PepperFileRefRendererHost(host_impl, pp_instance(), 0, path)); | 3131 new PepperFileRefRendererHost(host_impl, pp_instance(), 0, path)); |
| 3132 return host_impl->GetPpapiHost()->AddPendingResourceHost( | 3132 return host_impl->GetPpapiHost()->AddPendingResourceHost( |
| 3133 scoped_ptr<ppapi::host::ResourceHost>(file_ref_host)); | 3133 scoped_ptr<ppapi::host::ResourceHost>(file_ref_host)); |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3278 | 3278 |
| 3279 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { | 3279 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { |
| 3280 if (initialized_ && !javascript_used_ && is_flash_plugin_) { | 3280 if (initialized_ && !javascript_used_ && is_flash_plugin_) { |
| 3281 javascript_used_ = true; | 3281 javascript_used_ = true; |
| 3282 RenderThread::Get()->RecordAction( | 3282 RenderThread::Get()->RecordAction( |
| 3283 base::UserMetricsAction("Flash.JavaScriptUsed")); | 3283 base::UserMetricsAction("Flash.JavaScriptUsed")); |
| 3284 } | 3284 } |
| 3285 } | 3285 } |
| 3286 | 3286 |
| 3287 } // namespace content | 3287 } // namespace content |
| OLD | NEW |