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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 112 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
113 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 113 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
114 #include "third_party/WebKit/public/web/WebScriptSource.h" | 114 #include "third_party/WebKit/public/web/WebScriptSource.h" |
115 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" | 115 #include "third_party/WebKit/public/web/WebSecurityOrigin.h" |
116 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 116 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
117 #include "third_party/WebKit/public/web/WebView.h" | 117 #include "third_party/WebKit/public/web/WebView.h" |
118 #include "third_party/khronos/GLES2/gl2.h" | 118 #include "third_party/khronos/GLES2/gl2.h" |
119 #include "ui/gfx/image/image_skia.h" | 119 #include "ui/gfx/image/image_skia.h" |
120 #include "ui/gfx/image/image_skia_rep.h" | 120 #include "ui/gfx/image/image_skia_rep.h" |
121 #include "ui/gfx/range/range.h" | 121 #include "ui/gfx/range/range.h" |
| 122 #include "url/origin.h" |
122 #include "v8/include/v8.h" | 123 #include "v8/include/v8.h" |
123 | 124 |
124 #if defined(OS_CHROMEOS) | 125 #if defined(OS_CHROMEOS) |
125 #include "ui/events/keycodes/keyboard_codes_posix.h" | 126 #include "ui/events/keycodes/keyboard_codes_posix.h" |
126 #endif | 127 #endif |
127 | 128 |
128 using base::StringPrintf; | 129 using base::StringPrintf; |
129 using ppapi::InputEventData; | 130 using ppapi::InputEventData; |
130 using ppapi::PpapiGlobals; | 131 using ppapi::PpapiGlobals; |
131 using ppapi::PPB_InputEvent_Shared; | 132 using ppapi::PPB_InputEvent_Shared; |
(...skipping 1469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1601 // During the first view update, initialize the throttler. | 1602 // During the first view update, initialize the throttler. |
1602 if (!sent_initial_did_change_view_) { | 1603 if (!sent_initial_did_change_view_) { |
1603 if (is_flash_plugin_ && RenderThread::Get()) { | 1604 if (is_flash_plugin_ && RenderThread::Get()) { |
1604 RenderThread::Get()->RecordAction( | 1605 RenderThread::Get()->RecordAction( |
1605 base::UserMetricsAction("Flash.PluginInstanceCreated")); | 1606 base::UserMetricsAction("Flash.PluginInstanceCreated")); |
1606 RecordFlashSizeMetric(unobscured_rect_.width(), | 1607 RecordFlashSizeMetric(unobscured_rect_.width(), |
1607 unobscured_rect_.height()); | 1608 unobscured_rect_.height()); |
1608 } | 1609 } |
1609 | 1610 |
1610 if (throttler_) { | 1611 if (throttler_) { |
1611 throttler_->Initialize(render_frame_, plugin_url_.GetOrigin(), | 1612 throttler_->Initialize(render_frame_, url::Origin(plugin_url_), |
1612 module()->name(), unobscured_rect_.size()); | 1613 module()->name(), unobscured_rect_.size()); |
1613 } | 1614 } |
1614 } | 1615 } |
1615 | 1616 |
1616 ppapi::ViewData view_data = view_data_; | 1617 ppapi::ViewData view_data = view_data_; |
1617 | 1618 |
1618 // When plugin content is throttled, fake the page being offscreen. We cannot | 1619 // When plugin content is throttled, fake the page being offscreen. We cannot |
1619 // send empty view data here, as some plugins rely on accurate view data. | 1620 // send empty view data here, as some plugins rely on accurate view data. |
1620 if (throttler_ && throttler_->IsThrottled()) { | 1621 if (throttler_ && throttler_->IsThrottled()) { |
1621 view_data.is_page_visible = false; | 1622 view_data.is_page_visible = false; |
(...skipping 1649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3271 | 3272 |
3272 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { | 3273 void PepperPluginInstanceImpl::RecordFlashJavaScriptUse() { |
3273 if (initialized_ && !javascript_used_ && is_flash_plugin_) { | 3274 if (initialized_ && !javascript_used_ && is_flash_plugin_) { |
3274 javascript_used_ = true; | 3275 javascript_used_ = true; |
3275 RenderThread::Get()->RecordAction( | 3276 RenderThread::Get()->RecordAction( |
3276 base::UserMetricsAction("Flash.JavaScriptUsed")); | 3277 base::UserMetricsAction("Flash.JavaScriptUsed")); |
3277 } | 3278 } |
3278 } | 3279 } |
3279 | 3280 |
3280 } // namespace content | 3281 } // namespace content |
OLD | NEW |