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

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: 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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 699
700 WebSettings::SelectionStrategyType selection_strategy = 700 WebSettings::SelectionStrategyType selection_strategy =
701 WebSettings::SelectionStrategyType::Character; 701 WebSettings::SelectionStrategyType::Character;
702 const std::string selection_strategy_str = 702 const std::string selection_strategy_str =
703 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( 703 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
704 switches::kTouchTextSelectionStrategy); 704 switches::kTouchTextSelectionStrategy);
705 if (selection_strategy_str == "direction") 705 if (selection_strategy_str == "direction")
706 selection_strategy = WebSettings::SelectionStrategyType::Direction; 706 selection_strategy = WebSettings::SelectionStrategyType::Direction;
707 webview()->settings()->setSelectionStrategy(selection_strategy); 707 webview()->settings()->setSelectionStrategy(selection_strategy);
708 708
709 std::string passiveListenersDefault =
710 command_line.GetSwitchValueASCII(switches::kPassiveListenersDefault);
711 if (!passiveListenersDefault.empty()) {
712 WebSettings::PassiveEventListenerDefault passiveDefault =
713 WebSettings::PassiveEventListenerDefault::False;
714 if (passiveListenersDefault == "documentonlytrue")
715 passiveDefault = WebSettings::PassiveEventListenerDefault::DocumentTrue;
716 else if (passiveListenersDefault == "true")
717 passiveDefault = WebSettings::PassiveEventListenerDefault::True;
718 else if (passiveListenersDefault == "forcealltrue")
719 passiveDefault = WebSettings::PassiveEventListenerDefault::ForceAllTrue;
720 webview()->settings()->setPassiveEventListenerDefault(passiveDefault);
721 }
722
709 ApplyBlinkSettings(command_line, webview()->settings()); 723 ApplyBlinkSettings(command_line, webview()->settings());
710 724
711 if (params.main_frame_routing_id != MSG_ROUTING_NONE) { 725 if (params.main_frame_routing_id != MSG_ROUTING_NONE) {
712 main_render_frame_ = RenderFrameImpl::CreateMainFrame( 726 main_render_frame_ = RenderFrameImpl::CreateMainFrame(
713 this, params.main_frame_routing_id, params.main_frame_widget_routing_id, 727 this, params.main_frame_routing_id, params.main_frame_widget_routing_id,
714 params.hidden, screen_info(), compositor_deps_, opener_frame); 728 params.hidden, screen_info(), compositor_deps_, opener_frame);
715 } 729 }
716 730
717 if (params.proxy_routing_id != MSG_ROUTING_NONE) { 731 if (params.proxy_routing_id != MSG_ROUTING_NONE) {
718 CHECK(params.swapped_out); 732 CHECK(params.swapped_out);
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after
3424 if (IsUseZoomForDSFEnabled()) { 3438 if (IsUseZoomForDSFEnabled()) {
3425 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); 3439 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_);
3426 } else { 3440 } else {
3427 webview()->setDeviceScaleFactor(device_scale_factor_); 3441 webview()->setDeviceScaleFactor(device_scale_factor_);
3428 } 3442 }
3429 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3443 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3430 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3444 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3431 } 3445 }
3432 3446
3433 } // namespace content 3447 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698