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

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

Issue 696713002: Pointer/hover media query support: platform-dependent changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/android/BUILD.gn » ('j') | ui/android/BUILD.gn » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 const std::string autoplay_group_name = base::FieldTrialList::FindFullName( 415 const std::string autoplay_group_name = base::FieldTrialList::FindFullName(
416 "MediaElementAutoplay"); 416 "MediaElementAutoplay");
417 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch( 417 prefs.user_gesture_required_for_media_playback = !command_line.HasSwitch(
418 switches::kDisableGestureRequirementForMediaPlayback) && 418 switches::kDisableGestureRequirementForMediaPlayback) &&
419 (autoplay_group_name.empty() || autoplay_group_name != "Enabled"); 419 (autoplay_group_name.empty() || autoplay_group_name != "Enabled");
420 #endif 420 #endif
421 421
422 prefs.touch_enabled = ui::AreTouchEventsEnabled(); 422 prefs.touch_enabled = ui::AreTouchEventsEnabled();
423 prefs.device_supports_touch = prefs.touch_enabled && 423 prefs.device_supports_touch = prefs.touch_enabled &&
424 ui::IsTouchDevicePresent(); 424 ui::IsTouchDevicePresent();
425 prefs.available_pointer_types = ui::AvailablePointerTypes();
426 prefs.primary_pointer_type = ui::PrimaryPointerType();
427 prefs.available_hover_types = ui::AvailableHoverTypes();
428 prefs.primary_hover_type = ui::PrimaryHoverType();
429
425 #if defined(OS_ANDROID) 430 #if defined(OS_ANDROID)
426 prefs.device_supports_mouse = false; 431 prefs.device_supports_mouse = false;
427 #endif 432 #endif
428 433
429 prefs.pointer_events_max_touch_points = ui::MaxTouchPoints(); 434 prefs.pointer_events_max_touch_points = ui::MaxTouchPoints();
430 435
431 prefs.touch_adjustment_enabled = 436 prefs.touch_adjustment_enabled =
432 !command_line.HasSwitch(switches::kDisableTouchAdjustment); 437 !command_line.HasSwitch(switches::kDisableTouchAdjustment);
433 438
434 prefs.slimming_paint_enabled = 439 prefs.slimming_paint_enabled =
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 OnToggleFullscreen(false); 1341 OnToggleFullscreen(false);
1337 } 1342 }
1338 1343
1339 WebPreferences RenderViewHostImpl::GetWebkitPreferences() { 1344 WebPreferences RenderViewHostImpl::GetWebkitPreferences() {
1340 if (!web_preferences_.get()) { 1345 if (!web_preferences_.get()) {
1341 OnWebkitPreferencesChanged(); 1346 OnWebkitPreferencesChanged();
1342 } 1347 }
1343 return *web_preferences_; 1348 return *web_preferences_;
1344 } 1349 }
1345 1350
1346 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { 1351 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) {
jdduke (slow) 2014/11/26 19:29:28 Any idea how frequently this gets called?
mustaq 2014/11/26 19:51:50 It seems RenderViewHostImpl::CreateRenderView is t
jdduke (slow) 2014/11/26 20:05:38 I ask because each of the queries into Java are li
mustaq 2014/12/02 16:28:19 Acknowledged.
mustaq 2014/12/02 21:50:02 Here is a better answer to your original question:
1347 web_preferences_.reset(new WebPreferences(prefs)); 1352 web_preferences_.reset(new WebPreferences(prefs));
1348 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); 1353 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs));
1349 } 1354 }
1350 1355
1351 void RenderViewHostImpl::OnWebkitPreferencesChanged() { 1356 void RenderViewHostImpl::OnWebkitPreferencesChanged() {
1352 // This is defensive code to avoid infinite loops due to code run inside 1357 // This is defensive code to avoid infinite loops due to code run inside
1353 // UpdateWebkitPreferences() accidentally updating more preferences and thus 1358 // UpdateWebkitPreferences() accidentally updating more preferences and thus
1354 // calling back into this code. See crbug.com/398751 for one past example. 1359 // calling back into this code. See crbug.com/398751 for one past example.
1355 if (updating_web_preferences_) 1360 if (updating_web_preferences_)
1356 return; 1361 return;
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1468 FrameTree* frame_tree = delegate_->GetFrameTree(); 1473 FrameTree* frame_tree = delegate_->GetFrameTree();
1469 1474
1470 frame_tree->ResetForMainFrameSwap(); 1475 frame_tree->ResetForMainFrameSwap();
1471 } 1476 }
1472 1477
1473 void RenderViewHostImpl::SelectWordAroundCaret() { 1478 void RenderViewHostImpl::SelectWordAroundCaret() {
1474 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID())); 1479 Send(new ViewMsg_SelectWordAroundCaret(GetRoutingID()));
1475 } 1480 }
1476 1481
1477 } // namespace content 1482 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | ui/android/BUILD.gn » ('j') | ui/android/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698