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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 #include "content/public/browser/web_ui_controller_factory.h" | 60 #include "content/public/browser/web_ui_controller_factory.h" |
61 #include "content/public/common/bindings_policy.h" | 61 #include "content/public/common/bindings_policy.h" |
62 #include "content/public/common/content_constants.h" | 62 #include "content/public/common/content_constants.h" |
63 #include "content/public/common/content_restriction.h" | 63 #include "content/public/common/content_restriction.h" |
64 #include "content/public/common/content_switches.h" | 64 #include "content/public/common/content_switches.h" |
65 #include "content/public/common/url_constants.h" | 65 #include "content/public/common/url_constants.h" |
66 #include "net/base/mime_util.h" | 66 #include "net/base/mime_util.h" |
67 #include "net/base/net_util.h" | 67 #include "net/base/net_util.h" |
68 #include "net/base/network_change_notifier.h" | 68 #include "net/base/network_change_notifier.h" |
69 #include "net/url_request/url_request_context_getter.h" | 69 #include "net/url_request/url_request_context_getter.h" |
70 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCompositor.h" | |
71 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 70 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
72 #include "ui/base/layout.h" | 71 #include "ui/base/layout.h" |
73 #include "ui/base/ui_base_switches.h" | 72 #include "ui/base/ui_base_switches.h" |
74 #include "ui/gfx/display.h" | 73 #include "ui/gfx/display.h" |
75 #include "ui/gfx/screen.h" | 74 #include "ui/gfx/screen.h" |
76 #include "ui/gl/gl_switches.h" | 75 #include "ui/gl/gl_switches.h" |
77 #include "webkit/glue/web_intent_data.h" | 76 #include "webkit/glue/web_intent_data.h" |
78 #include "webkit/glue/web_intent_service_data.h" | 77 #include "webkit/glue/web_intent_service_data.h" |
79 #include "webkit/glue/webpreferences.h" | 78 #include "webkit/glue/webpreferences.h" |
80 | 79 |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 // chrome-devtools: pages (unless it's specifically allowed). | 590 // chrome-devtools: pages (unless it's specifically allowed). |
592 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) || | 591 if ((url.SchemeIs(chrome::kChromeDevToolsScheme) || |
593 url.SchemeIs(chrome::kChromeUIScheme) || | 592 url.SchemeIs(chrome::kChromeUIScheme) || |
594 (url.SchemeIs(chrome::kAboutScheme) && | 593 (url.SchemeIs(chrome::kAboutScheme) && |
595 url.spec() != chrome::kAboutBlankURL)) && | 594 url.spec() != chrome::kAboutBlankURL)) && |
596 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { | 595 !command_line.HasSwitch(switches::kAllowWebUICompositing)) { |
597 prefs.accelerated_compositing_enabled = false; | 596 prefs.accelerated_compositing_enabled = false; |
598 prefs.accelerated_2d_canvas_enabled = false; | 597 prefs.accelerated_2d_canvas_enabled = false; |
599 } | 598 } |
600 | 599 |
601 #if !defined(WEBCOMPOSITOR_OWNS_SETTINGS) | |
602 prefs.threaded_animation_enabled = | |
603 !command_line.HasSwitch(switches::kDisableThreadedAnimation); | |
604 prefs.per_tile_painting_enabled = | |
605 command_line.HasSwitch(switches::kEnablePerTilePainting); | |
606 prefs.partial_swap_enabled = | |
607 command_line.HasSwitch(switches::kEnablePartialSwap); | |
608 #endif | |
609 | |
610 if (command_line.HasSwitch(switches::kDefaultTileWidth)) | 600 if (command_line.HasSwitch(switches::kDefaultTileWidth)) |
611 prefs.default_tile_width = | 601 prefs.default_tile_width = |
612 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1); | 602 GetSwitchValueAsInt(command_line, switches::kDefaultTileWidth, 1); |
613 if (command_line.HasSwitch(switches::kDefaultTileHeight)) | 603 if (command_line.HasSwitch(switches::kDefaultTileHeight)) |
614 prefs.default_tile_height = | 604 prefs.default_tile_height = |
615 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1); | 605 GetSwitchValueAsInt(command_line, switches::kDefaultTileHeight, 1); |
616 if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth)) | 606 if (command_line.HasSwitch(switches::kMaxUntiledLayerWidth)) |
617 prefs.max_untiled_layer_width = | 607 prefs.max_untiled_layer_width = |
618 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerWidth, 1); | 608 GetSwitchValueAsInt(command_line, switches::kMaxUntiledLayerWidth, 1); |
619 if (command_line.HasSwitch(switches::kMaxUntiledLayerHeight)) | 609 if (command_line.HasSwitch(switches::kMaxUntiledLayerHeight)) |
(...skipping 2540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3160 old_browser_plugin_host()->embedder_render_process_host(); | 3150 old_browser_plugin_host()->embedder_render_process_host(); |
3161 *embedder_container_id = old_browser_plugin_host()->instance_id(); | 3151 *embedder_container_id = old_browser_plugin_host()->instance_id(); |
3162 int embedder_process_id = | 3152 int embedder_process_id = |
3163 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; | 3153 embedder_render_process_host ? embedder_render_process_host->GetID() : -1; |
3164 if (embedder_process_id != -1) { | 3154 if (embedder_process_id != -1) { |
3165 *embedder_channel_name = | 3155 *embedder_channel_name = |
3166 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), | 3156 StringPrintf("%d.r%d", render_view_host->GetProcess()->GetID(), |
3167 embedder_process_id); | 3157 embedder_process_id); |
3168 } | 3158 } |
3169 } | 3159 } |
OLD | NEW |