| OLD | NEW |
| 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" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 #include "content/public/common/content_constants.h" | 64 #include "content/public/common/content_constants.h" |
| 65 #include "content/public/common/content_restriction.h" | 65 #include "content/public/common/content_restriction.h" |
| 66 #include "content/public/common/content_switches.h" | 66 #include "content/public/common/content_switches.h" |
| 67 #include "content/public/common/url_constants.h" | 67 #include "content/public/common/url_constants.h" |
| 68 #include "net/base/mime_util.h" | 68 #include "net/base/mime_util.h" |
| 69 #include "net/base/net_util.h" | 69 #include "net/base/net_util.h" |
| 70 #include "net/base/network_change_notifier.h" | 70 #include "net/base/network_change_notifier.h" |
| 71 #include "net/url_request/url_request_context_getter.h" | 71 #include "net/url_request/url_request_context_getter.h" |
| 72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 72 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
| 73 #include "ui/base/layout.h" | 73 #include "ui/base/layout.h" |
| 74 #include "ui/base/touch/touch_device_win.h" |
| 74 #include "ui/base/ui_base_switches.h" | 75 #include "ui/base/ui_base_switches.h" |
| 75 #include "ui/gfx/display.h" | 76 #include "ui/gfx/display.h" |
| 76 #include "ui/gfx/screen.h" | 77 #include "ui/gfx/screen.h" |
| 77 #include "ui/gl/gl_switches.h" | 78 #include "ui/gl/gl_switches.h" |
| 78 #include "webkit/glue/web_intent_data.h" | 79 #include "webkit/glue/web_intent_data.h" |
| 79 #include "webkit/glue/web_intent_service_data.h" | 80 #include "webkit/glue/web_intent_service_data.h" |
| 80 #include "webkit/glue/webpreferences.h" | 81 #include "webkit/glue/webpreferences.h" |
| 81 | 82 |
| 82 #if defined(OS_MACOSX) | 83 #if defined(OS_MACOSX) |
| 83 #include "base/mac/foundation_util.h" | 84 #include "base/mac/foundation_util.h" |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 prefs.accelerated_video_enabled = | 521 prefs.accelerated_video_enabled = |
| 521 !command_line.HasSwitch(switches::kDisableAcceleratedVideo); | 522 !command_line.HasSwitch(switches::kDisableAcceleratedVideo); |
| 522 prefs.fullscreen_enabled = | 523 prefs.fullscreen_enabled = |
| 523 !command_line.HasSwitch(switches::kDisableFullScreen); | 524 !command_line.HasSwitch(switches::kDisableFullScreen); |
| 524 prefs.css_regions_enabled = | 525 prefs.css_regions_enabled = |
| 525 command_line.HasSwitch(switches::kEnableCssRegions); | 526 command_line.HasSwitch(switches::kEnableCssRegions); |
| 526 prefs.css_shaders_enabled = | 527 prefs.css_shaders_enabled = |
| 527 command_line.HasSwitch(switches::kEnableCssShaders); | 528 command_line.HasSwitch(switches::kEnableCssShaders); |
| 528 prefs.css_variables_enabled = | 529 prefs.css_variables_enabled = |
| 529 command_line.HasSwitch(switches::kEnableCssVariables); | 530 command_line.HasSwitch(switches::kEnableCssVariables); |
| 530 prefs.device_supports_touch = | |
| 531 ui::GetDisplayLayout() == ui::LAYOUT_TOUCH; | |
| 532 #if defined(USE_AURA) && defined(USE_X11) | 531 #if defined(USE_AURA) && defined(USE_X11) |
| 533 prefs.device_supports_touch |= | 532 prefs.device_supports_touch |= |
| 534 ui::TouchFactory::GetInstance()->IsTouchDevicePresent(); | 533 ui::TouchFactory::GetInstance()->IsTouchDevicePresent(); |
| 535 #endif | 534 #endif |
| 535 #if defined(OS_WIN) |
| 536 prefs.device_supports_touch = ui::IsTouchDevicePresent(); |
| 537 #endif |
| 536 #if defined(OS_ANDROID) | 538 #if defined(OS_ANDROID) |
| 537 prefs.device_supports_mouse = false; | 539 prefs.device_supports_mouse = false; |
| 538 #endif | 540 #endif |
| 539 | 541 |
| 540 #if defined(OS_MACOSX) | 542 #if defined(OS_MACOSX) |
| 541 bool default_enable_scroll_animator = true; | 543 bool default_enable_scroll_animator = true; |
| 542 #else | 544 #else |
| 543 // On CrOS, the launcher always passes in the --enable flag. | 545 // On CrOS, the launcher always passes in the --enable flag. |
| 544 bool default_enable_scroll_animator = false; | 546 bool default_enable_scroll_animator = false; |
| 545 #endif | 547 #endif |
| (...skipping 2736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3282 old_browser_plugin_host()->embedder_render_process_host(); | 3284 old_browser_plugin_host()->embedder_render_process_host(); |
| 3283 *embedder_container_id = old_browser_plugin_host()->instance_id(); | 3285 *embedder_container_id = old_browser_plugin_host()->instance_id(); |
| 3284 int embedder_process_id = | 3286 int embedder_process_id = |
| 3285 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3287 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
| 3286 if (embedder_process_id != -1) { | 3288 if (embedder_process_id != -1) { |
| 3287 *embedder_channel_name = | 3289 *embedder_channel_name = |
| 3288 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3290 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
| 3289 embedder_process_id); | 3291 embedder_process_id); |
| 3290 } | 3292 } |
| 3291 } | 3293 } |
| OLD | NEW |