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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 1965493002: Add runtime setting to force passive event listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments Created 4 years, 7 months 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 unified diff | Download patch
OLDNEW
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/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 716
717 WebSettings::SelectionStrategyType selection_strategy = 717 WebSettings::SelectionStrategyType selection_strategy =
718 WebSettings::SelectionStrategyType::Character; 718 WebSettings::SelectionStrategyType::Character;
719 const std::string selection_strategy_str = 719 const std::string selection_strategy_str =
720 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 720 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
721 switches::kTouchTextSelectionStrategy); 721 switches::kTouchTextSelectionStrategy);
722 if (selection_strategy_str == "direction") 722 if (selection_strategy_str == "direction")
723 selection_strategy = WebSettings::SelectionStrategyType::Direction; 723 selection_strategy = WebSettings::SelectionStrategyType::Direction;
724 webview()->settings()->setSelectionStrategy(selection_strategy); 724 webview()->settings()->setSelectionStrategy(selection_strategy);
725 725
726 std::string passiveListenersDefault =
727 command_line.GetSwitchValueASCII(switches::kPassiveListenersDefault);
728 if (!passiveListenersDefault.empty()) {
729 WebSettings::PassiveEventListenerDefault passiveDefault =
730 WebSettings::PassiveEventListenerDefault::False;
731 if (passiveListenersDefault == "documentonlytrue")
732 passiveDefault = WebSettings::PassiveEventListenerDefault::DocumentTrue;
733 else if (passiveListenersDefault == "true")
734 passiveDefault = WebSettings::PassiveEventListenerDefault::True;
735 else if (passiveListenersDefault == "forcealltrue")
736 passiveDefault = WebSettings::PassiveEventListenerDefault::ForceAllTrue;
737 webview()->settings()->setPassiveEventListenerDefault(passiveDefault);
738 }
739
726 ApplyBlinkSettings(command_line, webview()->settings()); 740 ApplyBlinkSettings(command_line, webview()->settings());
727 741
728 if (params.main_frame_routing_id != MSG_ROUTING_NONE) { 742 if (params.main_frame_routing_id != MSG_ROUTING_NONE) {
729 main_render_frame_ = RenderFrameImpl::CreateMainFrame( 743 main_render_frame_ = RenderFrameImpl::CreateMainFrame(
730 this, params.main_frame_routing_id, params.main_frame_widget_routing_id, 744 this, params.main_frame_routing_id, params.main_frame_widget_routing_id,
731 params.hidden, screen_info(), compositor_deps_, opener_frame); 745 params.hidden, screen_info(), compositor_deps_, opener_frame);
732 } 746 }
733 747
734 if (params.proxy_routing_id != MSG_ROUTING_NONE) { 748 if (params.proxy_routing_id != MSG_ROUTING_NONE) {
735 CHECK(params.swapped_out); 749 CHECK(params.swapped_out);
(...skipping 2654 matching lines...) Expand 10 before | Expand all | Expand 10 after
3390 return render_frame->focused_pepper_plugin(); 3404 return render_frame->focused_pepper_plugin();
3391 } 3405 }
3392 frame = frame->traverseNext(false); 3406 frame = frame->traverseNext(false);
3393 } 3407 }
3394 3408
3395 return nullptr; 3409 return nullptr;
3396 } 3410 }
3397 #endif 3411 #endif
3398 3412
3399 } // namespace content 3413 } // namespace content
OLDNEW
« no previous file with comments | « content/public/common/content_switches.cc ('k') | third_party/WebKit/Source/core/events/AddEventListenerOptionsDefaults.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698