Chromium Code Reviews| 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/renderer_host/render_view_host_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 #include "ui/gfx/geometry/dip_util.h" | 100 #include "ui/gfx/geometry/dip_util.h" |
| 101 #include "ui/gfx/platform_font_win.h" | 101 #include "ui/gfx/platform_font_win.h" |
| 102 #endif | 102 #endif |
| 103 | 103 |
| 104 using base::TimeDelta; | 104 using base::TimeDelta; |
| 105 using blink::WebConsoleMessage; | 105 using blink::WebConsoleMessage; |
| 106 using blink::WebInputEvent; | 106 using blink::WebInputEvent; |
| 107 using blink::WebMediaPlayerAction; | 107 using blink::WebMediaPlayerAction; |
| 108 using blink::WebPluginAction; | 108 using blink::WebPluginAction; |
| 109 | 109 |
| 110 const char kEnableAutomation[] = "enable-automation"; | |
|
bokan
2017/05/19 16:43:23
This should go in content_switches.cc/h
| |
| 111 | |
| 110 namespace content { | 112 namespace content { |
| 111 namespace { | 113 namespace { |
| 112 | 114 |
| 113 void GetPlatformSpecificPrefs(RendererPreferences* prefs) { | 115 void GetPlatformSpecificPrefs(RendererPreferences* prefs) { |
| 114 #if defined(OS_WIN) | 116 #if defined(OS_WIN) |
| 115 NONCLIENTMETRICS_XP metrics = {0}; | 117 NONCLIENTMETRICS_XP metrics = {0}; |
| 116 base::win::GetNonClientMetrics(&metrics); | 118 base::win::GetNonClientMetrics(&metrics); |
| 117 | 119 |
| 118 prefs->caption_font_family_name = metrics.lfCaptionFont.lfFaceName; | 120 prefs->caption_font_family_name = metrics.lfCaptionFont.lfFaceName; |
| 119 prefs->caption_font_height = gfx::PlatformFontWin::GetFontSize( | 121 prefs->caption_font_height = gfx::PlatformFontWin::GetFontSize( |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 prefs.user_gesture_required_for_presentation = !command_line.HasSwitch( | 549 prefs.user_gesture_required_for_presentation = !command_line.HasSwitch( |
| 548 switches::kDisableGestureRequirementForPresentation); | 550 switches::kDisableGestureRequirementForPresentation); |
| 549 | 551 |
| 550 if (delegate_ && delegate_->HideDownloadUI()) | 552 if (delegate_ && delegate_->HideDownloadUI()) |
| 551 prefs.hide_download_ui = true; | 553 prefs.hide_download_ui = true; |
| 552 | 554 |
| 553 // `media_controls_enabled` is `true` by default. | 555 // `media_controls_enabled` is `true` by default. |
| 554 if (delegate_ && delegate_->HasPersistentVideo()) | 556 if (delegate_ && delegate_->HasPersistentVideo()) |
| 555 prefs.media_controls_enabled = false; | 557 prefs.media_controls_enabled = false; |
| 556 | 558 |
| 559 if (command_line.HasSwitch(kEnableAutomation)) | |
| 560 prefs.automation_controlled = true; | |
| 561 | |
| 562 if (command_line.HasSwitch(switches::kHeadless)) | |
| 563 prefs.headless = true; | |
|
bokan
2017/05/19 16:43:23
Would it make sense to just set automation_control
| |
| 564 | |
| 557 prefs.background_video_track_optimization_enabled = | 565 prefs.background_video_track_optimization_enabled = |
| 558 base::FeatureList::IsEnabled(media::kBackgroundVideoTrackOptimization); | 566 base::FeatureList::IsEnabled(media::kBackgroundVideoTrackOptimization); |
| 559 | 567 |
| 560 // TODO(servolk, asvitkine): Query the value directly when it is available in | 568 // TODO(servolk, asvitkine): Query the value directly when it is available in |
| 561 // the renderer process. See https://crbug.com/681160. | 569 // the renderer process. See https://crbug.com/681160. |
| 562 prefs.enable_instant_source_buffer_gc = | 570 prefs.enable_instant_source_buffer_gc = |
| 563 variations::GetVariationParamByFeatureAsBool( | 571 variations::GetVariationParamByFeatureAsBool( |
| 564 media::kMemoryPressureBasedSourceBufferGC, | 572 media::kMemoryPressureBasedSourceBufferGC, |
| 565 "enable_instant_source_buffer_gc", false); | 573 "enable_instant_source_buffer_gc", false); |
| 566 | 574 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 961 } | 969 } |
| 962 | 970 |
| 963 void RenderViewHostImpl::ClosePageTimeout() { | 971 void RenderViewHostImpl::ClosePageTimeout() { |
| 964 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) | 972 if (delegate_->ShouldIgnoreUnresponsiveRenderer()) |
| 965 return; | 973 return; |
| 966 | 974 |
| 967 ClosePageIgnoringUnloadEvents(); | 975 ClosePageIgnoringUnloadEvents(); |
| 968 } | 976 } |
| 969 | 977 |
| 970 } // namespace content | 978 } // namespace content |
| OLD | NEW |