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/tab_contents/tab_contents.h" | 5 #include "content/browser/tab_contents/tab_contents.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 if (blacklist_type & content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) | 424 if (blacklist_type & content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING) |
425 prefs.accelerated_compositing_enabled = false; | 425 prefs.accelerated_compositing_enabled = false; |
426 if (blacklist_type & content::GPU_FEATURE_TYPE_WEBGL) | 426 if (blacklist_type & content::GPU_FEATURE_TYPE_WEBGL) |
427 prefs.experimental_webgl_enabled = false; | 427 prefs.experimental_webgl_enabled = false; |
428 if (blacklist_type & content::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS) | 428 if (blacklist_type & content::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS) |
429 prefs.accelerated_2d_canvas_enabled = false; | 429 prefs.accelerated_2d_canvas_enabled = false; |
430 if (blacklist_type & content::GPU_FEATURE_TYPE_MULTISAMPLING) | 430 if (blacklist_type & content::GPU_FEATURE_TYPE_MULTISAMPLING) |
431 prefs.gl_multisampling_enabled = false; | 431 prefs.gl_multisampling_enabled = false; |
432 | 432 |
433 // Accelerated video and animation are slower than regular when using a | 433 // Accelerated video and animation are slower than regular when using a |
434 // software 3d rasterizer. | 434 // software 3d rasterizer. 3D CSS may also be too slow to be worthwhile. |
435 if (gpu_data_manager->ShouldUseSoftwareRendering()) { | 435 if (gpu_data_manager->ShouldUseSoftwareRendering()) { |
436 prefs.accelerated_video_enabled = false; | 436 prefs.accelerated_video_enabled = false; |
437 prefs.accelerated_animation_enabled = false; | 437 prefs.accelerated_animation_enabled = false; |
| 438 prefs.accelerated_layers_enabled = false; |
438 } | 439 } |
439 } | 440 } |
440 | 441 |
441 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( | 442 if (ChildProcessSecurityPolicyImpl::GetInstance()->HasWebUIBindings( |
442 rvh->process()->GetID())) { | 443 rvh->process()->GetID())) { |
443 prefs.loads_images_automatically = true; | 444 prefs.loads_images_automatically = true; |
444 prefs.javascript_enabled = true; | 445 prefs.javascript_enabled = true; |
445 } | 446 } |
446 | 447 |
447 prefs.is_online = !net::NetworkChangeNotifier::IsOffline(); | 448 prefs.is_online = !net::NetworkChangeNotifier::IsOffline(); |
(...skipping 2023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2471 save_info, | 2472 save_info, |
2472 this); | 2473 this); |
2473 } | 2474 } |
2474 | 2475 |
2475 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { | 2476 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { |
2476 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); | 2477 RenderWidgetHostView* rwh_view = GetView()->CreateViewForWidget(rvh); |
2477 // Can be NULL during tests. | 2478 // Can be NULL during tests. |
2478 if (rwh_view) | 2479 if (rwh_view) |
2479 rwh_view->SetSize(GetView()->GetContainerSize()); | 2480 rwh_view->SetSize(GetView()->GetContainerSize()); |
2480 } | 2481 } |
OLD | NEW |