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

Side by Side Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 2467913002: Touch event flag should control only DOM event firing. (Closed)
Patch Set: nits Created 4 years, 1 month 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/browser/renderer_host/render_view_host_impl.h" 5 #include "content/browser/renderer_host/render_view_host_impl.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 #include "content/public/common/file_chooser_file_info.h" 79 #include "content/public/common/file_chooser_file_info.h"
80 #include "content/public/common/file_chooser_params.h" 80 #include "content/public/common/file_chooser_params.h"
81 #include "content/public/common/result_codes.h" 81 #include "content/public/common/result_codes.h"
82 #include "content/public/common/url_constants.h" 82 #include "content/public/common/url_constants.h"
83 #include "content/public/common/url_utils.h" 83 #include "content/public/common/url_utils.h"
84 #include "net/base/url_util.h" 84 #include "net/base/url_util.h"
85 #include "net/url_request/url_request_context_getter.h" 85 #include "net/url_request/url_request_context_getter.h"
86 #include "third_party/skia/include/core/SkBitmap.h" 86 #include "third_party/skia/include/core/SkBitmap.h"
87 #include "ui/base/clipboard/clipboard.h" 87 #include "ui/base/clipboard/clipboard.h"
88 #include "ui/base/touch/touch_device.h" 88 #include "ui/base/touch/touch_device.h"
89 #include "ui/base/touch/touch_enabled.h"
90 #include "ui/base/ui_base_switches.h" 89 #include "ui/base/ui_base_switches.h"
90 #include "ui/events/event_switches.h"
91 #include "ui/gfx/animation/animation.h" 91 #include "ui/gfx/animation/animation.h"
92 #include "ui/gfx/color_space.h" 92 #include "ui/gfx/color_space.h"
93 #include "ui/gfx/image/image_skia.h" 93 #include "ui/gfx/image/image_skia.h"
94 #include "ui/gfx/native_widget_types.h" 94 #include "ui/gfx/native_widget_types.h"
95 #include "ui/native_theme/native_theme_switches.h" 95 #include "ui/native_theme/native_theme_switches.h"
96 #include "url/url_constants.h" 96 #include "url/url_constants.h"
97 97
98 #if defined(OS_WIN) 98 #if defined(OS_WIN)
99 #include "ui/display/win/screen_win.h" 99 #include "ui/display/win/screen_win.h"
100 #include "ui/gfx/geometry/dip_util.h" 100 #include "ui/gfx/geometry/dip_util.h"
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 prefs.progress_bar_completion = GetProgressBarCompletionPolicy(); 446 prefs.progress_bar_completion = GetProgressBarCompletionPolicy();
447 447
448 prefs.use_solid_color_scrollbars = true; 448 prefs.use_solid_color_scrollbars = true;
449 #endif 449 #endif
450 450
451 // Handle autoplay gesture override experiment. 451 // Handle autoplay gesture override experiment.
452 // Note that anything but a well-formed string turns the experiment off. 452 // Note that anything but a well-formed string turns the experiment off.
453 prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName( 453 prefs.autoplay_experiment_mode = base::FieldTrialList::FindFullName(
454 "MediaElementGestureOverrideExperiment"); 454 "MediaElementGestureOverrideExperiment");
455 455
456 prefs.touch_enabled = ui::AreTouchEventsEnabled(); 456 prefs.touch_event_api_enabled =
457 prefs.device_supports_touch = prefs.touch_enabled && 457 !(command_line.HasSwitch(switches::kTouchEvents) &&
458 ui::GetTouchScreensAvailability() == 458 command_line.GetSwitchValueASCII(switches::kTouchEvents) ==
459 ui::TouchScreensAvailability::ENABLED; 459 switches::kTouchEventsDisabled);
dcheng 2016/11/17 11:25:11 I'm a bit confused why the pref is called "enabled
mustaq 2016/11/17 13:44:30 I also got a bit confused about it on my first rea
460 prefs.device_supports_touch = ui::GetTouchScreensAvailability() ==
461 ui::TouchScreensAvailability::ENABLED;
460 std::tie(prefs.available_pointer_types, prefs.available_hover_types) = 462 std::tie(prefs.available_pointer_types, prefs.available_hover_types) =
461 ui::GetAvailablePointerAndHoverTypes(); 463 ui::GetAvailablePointerAndHoverTypes();
462 prefs.primary_pointer_type = 464 prefs.primary_pointer_type =
463 ui::GetPrimaryPointerType(prefs.available_pointer_types); 465 ui::GetPrimaryPointerType(prefs.available_pointer_types);
464 prefs.primary_hover_type = 466 prefs.primary_hover_type =
465 ui::GetPrimaryHoverType(prefs.available_hover_types); 467 ui::GetPrimaryHoverType(prefs.available_hover_types);
466 468
467 #if defined(OS_ANDROID) 469 #if defined(OS_ANDROID)
468 prefs.device_supports_mouse = false; 470 prefs.device_supports_mouse = false;
469 #endif 471 #endif
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
1097 } else { 1099 } else {
1098 render_view_ready_on_process_launch_ = true; 1100 render_view_ready_on_process_launch_ = true;
1099 } 1101 }
1100 } 1102 }
1101 1103
1102 void RenderViewHostImpl::RenderViewReady() { 1104 void RenderViewHostImpl::RenderViewReady() {
1103 delegate_->RenderViewReady(this); 1105 delegate_->RenderViewReady(this);
1104 } 1106 }
1105 1107
1106 } // namespace content 1108 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698