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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 #include "ui/gl/gl_switches.h" | 75 #include "ui/gl/gl_switches.h" |
76 #include "webkit/glue/web_intent_data.h" | 76 #include "webkit/glue/web_intent_data.h" |
77 #include "webkit/glue/web_intent_service_data.h" | 77 #include "webkit/glue/web_intent_service_data.h" |
78 #include "webkit/glue/webpreferences.h" | 78 #include "webkit/glue/webpreferences.h" |
79 | 79 |
80 #if defined(OS_MACOSX) | 80 #if defined(OS_MACOSX) |
81 #include "base/mac/foundation_util.h" | 81 #include "base/mac/foundation_util.h" |
82 #include "ui/surface/io_surface_support_mac.h" | 82 #include "ui/surface/io_surface_support_mac.h" |
83 #endif | 83 #endif |
84 | 84 |
| 85 #if defined(USE_AURA) && defined(USE_X11) |
| 86 #include "ui/base/touch/touch_factory.h" |
| 87 #endif // defined (USE_AURA) && defined(USE_X11) |
| 88 |
85 // Cross-Site Navigations | 89 // Cross-Site Navigations |
86 // | 90 // |
87 // If a WebContentsImpl is told to navigate to a different web site (as | 91 // If a WebContentsImpl is told to navigate to a different web site (as |
88 // determined by SiteInstance), it will replace its current RenderViewHost with | 92 // determined by SiteInstance), it will replace its current RenderViewHost with |
89 // a new RenderViewHost dedicated to the new SiteInstance. This works as | 93 // a new RenderViewHost dedicated to the new SiteInstance. This works as |
90 // follows: | 94 // follows: |
91 // | 95 // |
92 // - Navigate determines whether the destination is cross-site, and if so, | 96 // - Navigate determines whether the destination is cross-site, and if so, |
93 // it creates a pending_render_view_host_. | 97 // it creates a pending_render_view_host_. |
94 // - The pending RVH is "suspended," so that no navigation messages are sent to | 98 // - The pending RVH is "suspended," so that no navigation messages are sent to |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
525 prefs.fullscreen_enabled = | 529 prefs.fullscreen_enabled = |
526 !command_line.HasSwitch(switches::kDisableFullScreen); | 530 !command_line.HasSwitch(switches::kDisableFullScreen); |
527 prefs.css_regions_enabled = | 531 prefs.css_regions_enabled = |
528 command_line.HasSwitch(switches::kEnableCssRegions); | 532 command_line.HasSwitch(switches::kEnableCssRegions); |
529 prefs.css_shaders_enabled = | 533 prefs.css_shaders_enabled = |
530 command_line.HasSwitch(switches::kEnableCssShaders); | 534 command_line.HasSwitch(switches::kEnableCssShaders); |
531 prefs.css_variables_enabled = | 535 prefs.css_variables_enabled = |
532 command_line.HasSwitch(switches::kEnableCssVariables); | 536 command_line.HasSwitch(switches::kEnableCssVariables); |
533 prefs.device_supports_touch = | 537 prefs.device_supports_touch = |
534 ui::GetDisplayLayout() == ui::LAYOUT_TOUCH; | 538 ui::GetDisplayLayout() == ui::LAYOUT_TOUCH; |
| 539 #if defined(USE_AURA) && defined(USE_X11) |
| 540 prefs.device_supports_touch |= |
| 541 ui::TouchFactory::GetInstance()->IsTouchDevicePresent(); |
| 542 #endif |
535 #if defined(OS_ANDROID) | 543 #if defined(OS_ANDROID) |
536 prefs.device_supports_mouse = false; | 544 prefs.device_supports_mouse = false; |
537 #endif | 545 #endif |
538 | 546 |
539 #if defined(OS_MACOSX) | 547 #if defined(OS_MACOSX) |
540 bool default_enable_scroll_animator = true; | 548 bool default_enable_scroll_animator = true; |
541 #else | 549 #else |
542 // On CrOS, the launcher always passes in the --enable flag. | 550 // On CrOS, the launcher always passes in the --enable flag. |
543 bool default_enable_scroll_animator = false; | 551 bool default_enable_scroll_animator = false; |
544 #endif | 552 #endif |
(...skipping 2596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3141 old_browser_plugin_host()->embedder_render_process_host(); | 3149 old_browser_plugin_host()->embedder_render_process_host(); |
3142 *embedder_container_id = old_browser_plugin_host()->instance_id(); | 3150 *embedder_container_id = old_browser_plugin_host()->instance_id(); |
3143 int embedder_process_id = | 3151 int embedder_process_id = |
3144 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3152 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
3145 if (embedder_process_id != -1) { | 3153 if (embedder_process_id != -1) { |
3146 *embedder_channel_name = | 3154 *embedder_channel_name = |
3147 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3155 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
3148 embedder_process_id); | 3156 embedder_process_id); |
3149 } | 3157 } |
3150 } | 3158 } |
OLD | NEW |