Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(173)

Unified Diff: content/renderer/pepper/pepper_plugin_instance_throttler.cc

Issue 802453004: Plugin Power Saver: Improve right-click and middle-click behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@0208-plugin-power-saver-fix-black-video-on-resume-problem
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_instance_throttler_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/pepper_plugin_instance_throttler.cc
diff --git a/content/renderer/pepper/pepper_plugin_instance_throttler.cc b/content/renderer/pepper/pepper_plugin_instance_throttler.cc
index 3f9ec7da119f8fb6ecea235074254b96f55d2035..de9edba4a1df7597420c136b9220198bd54687ad 100644
--- a/content/renderer/pepper/pepper_plugin_instance_throttler.cc
+++ b/content/renderer/pepper/pepper_plugin_instance_throttler.cc
@@ -163,13 +163,22 @@ void PepperPluginInstanceThrottler::OnImageFlush(const SkBitmap* bitmap) {
bool PepperPluginInstanceThrottler::ConsumeInputEvent(
const blink::WebInputEvent& event) {
+ // Always allow right-clicks through so users may verify it's a plug-in.
+ // TODO(tommycli): We should instead show a custom context menu (probably
+ // using PluginPlaceholder) so users aren't confused and try to click the
+ // Flash-internal 'Play' menu item. This is a stopgap solution.
+ if (event.modifiers & blink::WebInputEvent::Modifiers::RightButtonDown)
+ return false;
+
if (!has_been_clicked_ && is_flash_plugin_ &&
- event.type == blink::WebInputEvent::MouseDown) {
+ event.type == blink::WebInputEvent::MouseDown &&
+ (event.modifiers & blink::WebInputEvent::LeftButtonDown)) {
has_been_clicked_ = true;
RecordFlashClickSizeMetric(bounds_.width, bounds_.height);
}
- if (event.type == blink::WebInputEvent::MouseUp && is_peripheral_content_) {
+ if (is_peripheral_content_ && event.type == blink::WebInputEvent::MouseUp &&
+ (event.modifiers & blink::WebInputEvent::LeftButtonDown)) {
is_peripheral_content_ = false;
power_saver_enabled_ = false;
needs_representative_keyframe_ = false;
« no previous file with comments | « no previous file | content/renderer/pepper/pepper_plugin_instance_throttler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698