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

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: Moved IsTouchDevicePresent to ui::base Created 8 years, 3 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 | ui/base/touch/touch_device.h » ('j') | ui/base/touch/touch_device.h » ('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/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/win_util.h"
sky 2012/08/23 22:54:34 Remove this.
girard 2012/08/24 14:30:12 Done.
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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 #include "content/public/common/content_constants.h" 65 #include "content/public/common/content_constants.h"
65 #include "content/public/common/content_restriction.h" 66 #include "content/public/common/content_restriction.h"
66 #include "content/public/common/content_switches.h" 67 #include "content/public/common/content_switches.h"
67 #include "content/public/common/url_constants.h" 68 #include "content/public/common/url_constants.h"
68 #include "net/base/mime_util.h" 69 #include "net/base/mime_util.h"
69 #include "net/base/net_util.h" 70 #include "net/base/net_util.h"
70 #include "net/base/network_change_notifier.h" 71 #include "net/base/network_change_notifier.h"
71 #include "net/url_request/url_request_context_getter.h" 72 #include "net/url_request/url_request_context_getter.h"
72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" 73 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h"
73 #include "ui/base/layout.h" 74 #include "ui/base/layout.h"
75 #include "ui/base/touch/touch_device.h"
74 #include "ui/base/ui_base_switches.h" 76 #include "ui/base/ui_base_switches.h"
75 #include "ui/gfx/display.h" 77 #include "ui/gfx/display.h"
76 #include "ui/gfx/screen.h" 78 #include "ui/gfx/screen.h"
77 #include "ui/gl/gl_switches.h" 79 #include "ui/gl/gl_switches.h"
78 #include "webkit/glue/web_intent_data.h" 80 #include "webkit/glue/web_intent_data.h"
79 #include "webkit/glue/web_intent_service_data.h" 81 #include "webkit/glue/web_intent_service_data.h"
80 #include "webkit/glue/webpreferences.h" 82 #include "webkit/glue/webpreferences.h"
81 83
82 #if defined(OS_MACOSX) 84 #if defined(OS_MACOSX)
83 #include "base/mac/foundation_util.h" 85 #include "base/mac/foundation_util.h"
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 prefs.accelerated_video_enabled = 521 prefs.accelerated_video_enabled =
520 !command_line.HasSwitch(switches::kDisableAcceleratedVideo); 522 !command_line.HasSwitch(switches::kDisableAcceleratedVideo);
521 prefs.fullscreen_enabled = 523 prefs.fullscreen_enabled =
522 !command_line.HasSwitch(switches::kDisableFullScreen); 524 !command_line.HasSwitch(switches::kDisableFullScreen);
523 prefs.css_regions_enabled = 525 prefs.css_regions_enabled =
524 command_line.HasSwitch(switches::kEnableCssRegions); 526 command_line.HasSwitch(switches::kEnableCssRegions);
525 prefs.css_shaders_enabled = 527 prefs.css_shaders_enabled =
526 command_line.HasSwitch(switches::kEnableCssShaders); 528 command_line.HasSwitch(switches::kEnableCssShaders);
527 prefs.css_variables_enabled = 529 prefs.css_variables_enabled =
528 command_line.HasSwitch(switches::kEnableCssVariables); 530 command_line.HasSwitch(switches::kEnableCssVariables);
529 prefs.device_supports_touch =
530 ui::GetDisplayLayout() == ui::LAYOUT_TOUCH;
531 #if defined(USE_AURA) && defined(USE_X11) 531 #if defined(USE_AURA) && defined(USE_X11)
532 prefs.device_supports_touch |= 532 prefs.device_supports_touch |=
533 ui::TouchFactory::GetInstance()->IsTouchDevicePresent(); 533 ui::TouchFactory::GetInstance()->IsTouchDevicePresent();
534 #endif 534 #endif
535 #if defined(OS_WIN)
536 prefs.device_supports_touch = ui::base::IsTouchDevicePresent();
537 #endif
535 #if defined(OS_ANDROID) 538 #if defined(OS_ANDROID)
536 prefs.device_supports_mouse = false; 539 prefs.device_supports_mouse = false;
537 #endif 540 #endif
538 541
539 #if defined(OS_MACOSX) 542 #if defined(OS_MACOSX)
540 bool default_enable_scroll_animator = true; 543 bool default_enable_scroll_animator = true;
541 #else 544 #else
542 // On CrOS, the launcher always passes in the --enable flag. 545 // On CrOS, the launcher always passes in the --enable flag.
543 bool default_enable_scroll_animator = false; 546 bool default_enable_scroll_animator = false;
544 #endif 547 #endif
(...skipping 2657 matching lines...) Expand 10 before | Expand all | Expand 10 after
3202 old_browser_plugin_host()->embedder_render_process_host(); 3205 old_browser_plugin_host()->embedder_render_process_host();
3203 *embedder_container_id = old_browser_plugin_host()->instance_id(); 3206 *embedder_container_id = old_browser_plugin_host()->instance_id();
3204 int embedder_process_id = 3207 int embedder_process_id =
3205 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; 3208 embedder_render_process_host ? embedder_render_process_host->GetID() : -1;
3206 if (embedder_process_id != -1) { 3209 if (embedder_process_id != -1) {
3207 *embedder_channel_name = 3210 *embedder_channel_name =
3208 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), 3211 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(),
3209 embedder_process_id); 3212 embedder_process_id);
3210 } 3213 }
3211 } 3214 }
OLDNEW
« no previous file with comments | « no previous file | ui/base/touch/touch_device.h » ('j') | ui/base/touch/touch_device.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698