| OLD | NEW |
| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 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). | 82 // screen size correctly (so no need to resize when first window is created). |
| 83 const char kCastInitialScreenWidth[] = "cast-initial-screen-width"; | 83 const char kCastInitialScreenWidth[] = "cast-initial-screen-width"; |
| 84 const char kCastInitialScreenHeight[] = "cast-initial-screen-height"; | 84 const char kCastInitialScreenHeight[] = "cast-initial-screen-height"; |
| 85 | 85 |
| 86 // When present, desktop cast_shell will create 1080p window (provided display |
| 87 // resolution is high enough). Otherwise, cast_shell defaults to 720p. |
| 88 const char kDesktopWindow1080p[] = "desktop-window-1080p"; |
| 89 |
| 86 } // namespace switches | 90 } // namespace switches |
| 87 | 91 |
| 88 namespace chromecast { | 92 namespace chromecast { |
| 89 | 93 |
| 90 bool GetSwitchValueBoolean(const std::string& switch_string, | 94 bool GetSwitchValueBoolean(const std::string& switch_string, |
| 91 const bool default_value) { | 95 const bool default_value) { |
| 92 const base::CommandLine* command_line = | 96 const base::CommandLine* command_line = |
| 93 base::CommandLine::ForCurrentProcess(); | 97 base::CommandLine::ForCurrentProcess(); |
| 94 if (command_line->HasSwitch(switch_string)) { | 98 if (command_line->HasSwitch(switch_string)) { |
| 95 if (command_line->GetSwitchValueASCII(switch_string) != | 99 if (command_line->GetSwitchValueASCII(switch_string) != |
| 96 switches::kSwitchValueTrue && | 100 switches::kSwitchValueTrue && |
| 97 command_line->GetSwitchValueASCII(switch_string) != | 101 command_line->GetSwitchValueASCII(switch_string) != |
| 98 switches::kSwitchValueFalse && | 102 switches::kSwitchValueFalse && |
| 99 command_line->GetSwitchValueASCII(switch_string) != "") { | 103 command_line->GetSwitchValueASCII(switch_string) != "") { |
| 100 LOG(WARNING) << "Invalid switch value " << switch_string << "=" | 104 LOG(WARNING) << "Invalid switch value " << switch_string << "=" |
| 101 << command_line->GetSwitchValueASCII(switch_string) | 105 << command_line->GetSwitchValueASCII(switch_string) |
| 102 << "; assuming default value of " << default_value; | 106 << "; assuming default value of " << default_value; |
| 103 return default_value; | 107 return default_value; |
| 104 } | 108 } |
| 105 return command_line->GetSwitchValueASCII(switch_string) != | 109 return command_line->GetSwitchValueASCII(switch_string) != |
| 106 switches::kSwitchValueFalse; | 110 switches::kSwitchValueFalse; |
| 107 } | 111 } |
| 108 return default_value; | 112 return default_value; |
| 109 } | 113 } |
| 110 | 114 |
| 111 } // namespace chromecast | 115 } // namespace chromecast |
| OLD | NEW |