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

Side by Side Diff: chromecast/base/chromecast_switches.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/base/chromecast_switches.h" 5 #include "chromecast/base/chromecast_switches.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 8
9 namespace switches { 9 namespace switches {
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 // Optional flag to set a fixed sample rate for the alsa device. 71 // Optional flag to set a fixed sample rate for the alsa device.
72 const char kAlsaFixedOutputSampleRate[] = "alsa-fixed-output-sample-rate"; 72 const char kAlsaFixedOutputSampleRate[] = "alsa-fixed-output-sample-rate";
73 73
74 // Some platforms typically have very little 'free' memory, but plenty is 74 // Some platforms typically have very little 'free' memory, but plenty is
75 // available in buffers+cached. For such platforms, configure this amount 75 // available in buffers+cached. For such platforms, configure this amount
76 // as the portion of buffers+cached memory that should be treated as 76 // as the portion of buffers+cached memory that should be treated as
77 // unavailable. If this switch is not used, a simple pressure heuristic based 77 // unavailable. If this switch is not used, a simple pressure heuristic based
78 // purely on free memory will be used. 78 // purely on free memory will be used.
79 const char kMemPressureSystemReservedKb[] = "mem-pressure-system-reserved-kb"; 79 const char kMemPressureSystemReservedKb[] = "mem-pressure-system-reserved-kb";
80 80
81 // Used to pass initial screen resolution to GPU process. This allows us to set
82 // screen size correctly (so no need to resize when first window is created).
83 const char kCastInitialScreenWidth[] = "cast-initial-screen-width";
84 const char kCastInitialScreenHeight[] = "cast-initial-screen-height";
85
81 } // namespace switches 86 } // namespace switches
82 87
83 namespace chromecast { 88 namespace chromecast {
84 89
85 bool GetSwitchValueBoolean(const std::string& switch_string, 90 bool GetSwitchValueBoolean(const std::string& switch_string,
86 const bool default_value) { 91 const bool default_value) {
87 const base::CommandLine* command_line = 92 const base::CommandLine* command_line =
88 base::CommandLine::ForCurrentProcess(); 93 base::CommandLine::ForCurrentProcess();
89 if (command_line->HasSwitch(switch_string)) { 94 if (command_line->HasSwitch(switch_string)) {
90 if (command_line->GetSwitchValueASCII(switch_string) != 95 if (command_line->GetSwitchValueASCII(switch_string) !=
91 switches::kSwitchValueTrue && 96 switches::kSwitchValueTrue &&
92 command_line->GetSwitchValueASCII(switch_string) != 97 command_line->GetSwitchValueASCII(switch_string) !=
93 switches::kSwitchValueFalse && 98 switches::kSwitchValueFalse &&
94 command_line->GetSwitchValueASCII(switch_string) != "") { 99 command_line->GetSwitchValueASCII(switch_string) != "") {
95 LOG(WARNING) << "Invalid switch value " << switch_string << "=" 100 LOG(WARNING) << "Invalid switch value " << switch_string << "="
96 << command_line->GetSwitchValueASCII(switch_string) 101 << command_line->GetSwitchValueASCII(switch_string)
97 << "; assuming default value of " << default_value; 102 << "; assuming default value of " << default_value;
98 return default_value; 103 return default_value;
99 } 104 }
100 return command_line->GetSwitchValueASCII(switch_string) != 105 return command_line->GetSwitchValueASCII(switch_string) !=
101 switches::kSwitchValueFalse; 106 switches::kSwitchValueFalse;
102 } 107 }
103 return default_value; 108 return default_value;
104 } 109 }
105 110
106 } // namespace chromecast 111 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/base/chromecast_switches.h ('k') | chromecast/browser/cast_content_browser_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698