Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6874)

Unified Diff: chromecast/browser/cast_content_browser_client.cc

Issue 2119583002: [Chromecast] Set Cast Ozone display size correctly first time (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits + fix ResizeDisplay Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromecast/base/chromecast_switches.cc ('k') | ui/ozone/platform/cast/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..06ac8187e11529d6e57ffe9e53e8628e38e7fbc6 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,20 @@ 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();
+ if (!command_line->HasSwitch(switches::kCastInitialScreenWidth)) {
+ command_line->AppendSwitchASCII(switches::kCastInitialScreenWidth,
+ base::IntToString(res.width()));
+ }
+ if (!command_line->HasSwitch(switches::kCastInitialScreenHeight)) {
+ command_line->AppendSwitchASCII(switches::kCastInitialScreenHeight,
+ base::IntToString(res.height()));
+ }
+ }
}
void CastContentBrowserClient::PreCreateThreads() {
« no previous file with comments | « chromecast/base/chromecast_switches.cc ('k') | ui/ozone/platform/cast/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698