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

Side by Side Diff: content/browser/web_contents/web_contents_impl.cc

Issue 10836349: CSS Media Query now reports touch-support accurately for Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Code cleaned up for review. Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
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/web_contents/web_contents_impl.h" 5 #include "content/browser/web_contents/web_contents_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/metrics/stats_counters.h" 11 #include "base/metrics/stats_counters.h"
12 #include "base/string16.h" 12 #include "base/string16.h"
13 #include "base/string_number_conversions.h" 13 #include "base/string_number_conversions.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "base/sys_info.h" 15 #include "base/sys_info.h"
16 #include "base/time.h" 16 #include "base/time.h"
17 #include "base/utf_string_conversions.h" 17 #include "base/utf_string_conversions.h"
18 #include "base/win/windows_version.h"
18 #include "content/browser/browser_plugin/old/old_browser_plugin_host.h" 19 #include "content/browser/browser_plugin/old/old_browser_plugin_host.h"
19 #include "content/browser/child_process_security_policy_impl.h" 20 #include "content/browser/child_process_security_policy_impl.h"
20 #include "content/browser/debugger/devtools_manager_impl.h" 21 #include "content/browser/debugger/devtools_manager_impl.h"
21 #include "content/browser/dom_storage/dom_storage_context_impl.h" 22 #include "content/browser/dom_storage/dom_storage_context_impl.h"
22 #include "content/browser/dom_storage/session_storage_namespace_impl.h" 23 #include "content/browser/dom_storage/session_storage_namespace_impl.h"
23 #include "content/browser/download/download_stats.h" 24 #include "content/browser/download/download_stats.h"
24 #include "content/browser/download/mhtml_generation_manager.h" 25 #include "content/browser/download/mhtml_generation_manager.h"
25 #include "content/browser/download/save_package.h" 26 #include "content/browser/download/save_package.h"
26 #include "content/browser/gpu/gpu_data_manager_impl.h" 27 #include "content/browser/gpu/gpu_data_manager_impl.h"
27 #include "content/browser/gpu/gpu_process_host.h" 28 #include "content/browser/gpu/gpu_process_host.h"
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 !command_line.HasSwitch(switches::kDisableAcceleratedVideo); 520 !command_line.HasSwitch(switches::kDisableAcceleratedVideo);
520 prefs.fullscreen_enabled = 521 prefs.fullscreen_enabled =
521 !command_line.HasSwitch(switches::kDisableFullScreen); 522 !command_line.HasSwitch(switches::kDisableFullScreen);
522 prefs.css_regions_enabled = 523 prefs.css_regions_enabled =
523 command_line.HasSwitch(switches::kEnableCssRegions); 524 command_line.HasSwitch(switches::kEnableCssRegions);
524 prefs.css_shaders_enabled = 525 prefs.css_shaders_enabled =
525 command_line.HasSwitch(switches::kEnableCssShaders); 526 command_line.HasSwitch(switches::kEnableCssShaders);
526 prefs.css_variables_enabled = 527 prefs.css_variables_enabled =
527 command_line.HasSwitch(switches::kEnableCssVariables); 528 command_line.HasSwitch(switches::kEnableCssVariables);
528 prefs.device_supports_touch = 529 prefs.device_supports_touch =
529 ui::GetDisplayLayout() == ui::LAYOUT_TOUCH; 530 ui::GetDisplayLayout() == ui::LAYOUT_TOUCH;
Rick Byers 2012/08/21 11:26:16 You might as well remove this line now (or explici
girard 2012/08/23 15:57:23 Done.
530 #if defined(USE_AURA) && defined(USE_X11) 531 #if defined(USE_AURA) && defined(USE_X11)
531 prefs.device_supports_touch |= 532 prefs.device_supports_touch |=
532 ui::TouchFactory::GetInstance()->IsTouchDevicePresent(); 533 ui::TouchFactory::GetInstance()->IsTouchDevicePresent();
533 #endif 534 #endif
535 #if defined(OS_WIN)
536 if (base::win::GetVersion() >= base::win::VERSION_WIN7)
537 // Docs: http://msdn.microsoft.com/en-us/library/dd371581(VS.85).aspx
girard 2012/08/20 21:15:18 Q: Is it reasonable to leave a documentation link
sky 2012/08/20 22:53:49 Yes.
538 prefs.device_supports_touch = (::GetSystemMetrics(SM_DIGITIZER) > 0);
girard 2012/08/20 21:15:18 Q: Would it be better to move this out to base::wi
sky 2012/08/20 22:53:49 That sounds better to me.
girard 2012/08/23 15:57:23 Done.
539 #endif
534 #if defined(OS_ANDROID) 540 #if defined(OS_ANDROID)
535 prefs.device_supports_mouse = false; 541 prefs.device_supports_mouse = false;
536 #endif 542 #endif
537 543
538 #if defined(OS_MACOSX) 544 #if defined(OS_MACOSX)
539 bool default_enable_scroll_animator = true; 545 bool default_enable_scroll_animator = true;
540 #else 546 #else
541 // On CrOS, the launcher always passes in the --enable flag. 547 // On CrOS, the launcher always passes in the --enable flag.
542 bool default_enable_scroll_animator = false; 548 bool default_enable_scroll_animator = false;
543 #endif 549 #endif
(...skipping 2660 matching lines...) Expand 10 before | Expand all | Expand 10 after
3204 old_browser_plugin_host()->embedder_render_process_host(); 3210 old_browser_plugin_host()->embedder_render_process_host();
3205 *embedder_container_id = old_browser_plugin_host()->instance_id(); 3211 *embedder_container_id = old_browser_plugin_host()->instance_id();
3206 int embedder_process_id = 3212 int embedder_process_id =
3207 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; 3213 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
3208 if (embedder_process_id != -1) { 3214 if (embedder_process_id != -1) {
3209 *embedder_channel_name = 3215 *embedder_channel_name =
3210 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), 3216 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
3211 embedder_process_id); 3217 embedder_process_id);
3212 } 3218 }
3213 } 3219 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698