Index: chromecast/browser/cast_content_browser_client.cc |
diff --git a/chromecast/browser/cast_content_browser_client.cc b/chromecast/browser/cast_content_browser_client.cc |
index b31d7635ca935571e0cc1f4e539cdcf284e537c5..1c73523725b6272d27c6a05a36d4a31e18305661 100644 |
--- a/chromecast/browser/cast_content_browser_client.cc |
+++ b/chromecast/browser/cast_content_browser_client.cc |
@@ -16,6 +16,7 @@ |
#include "base/macros.h" |
#include "base/memory/ptr_util.h" |
#include "base/path_service.h" |
+#include "base/strings/string_number_conversions.h" |
#include "base/strings/utf_string_conversions.h" |
#include "build/build_config.h" |
#include "chromecast/base/cast_constants.h" |
@@ -50,6 +51,8 @@ |
#include "content/public/common/web_preferences.h" |
#include "net/ssl/ssl_cert_request_info.h" |
#include "net/url_request/url_request_context_getter.h" |
+#include "ui/display/display.h" |
+#include "ui/display/screen.h" |
#include "ui/gl/gl_switches.h" |
#if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) |
@@ -98,6 +101,16 @@ CastContentBrowserClient::~CastContentBrowserClient() { |
void CastContentBrowserClient::AppendExtraCommandLineSwitches( |
base::CommandLine* command_line) { |
+ std::string process_type = |
+ command_line->GetSwitchValueNative(switches::kProcessType); |
+ if (process_type == switches::kGpuProcess) { |
+ gfx::Size res = |
+ display::Screen::GetScreen()->GetPrimaryDisplay().GetSizeInPixel(); |
+ command_line->AppendSwitchASCII(switches::kInitialScreenWidth, |
alokp
2016/07/06 16:58:44
It might be desirable to also allow specifying it
halliwell
2016/07/07 20:07:14
Done.
|
+ base::IntToString(res.width())); |
+ command_line->AppendSwitchASCII(switches::kInitialScreenHeight, |
+ base::IntToString(res.height())); |
+ } |
} |
void CastContentBrowserClient::PreCreateThreads() { |