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 "chrome/browser/ui/browser_window_state.h" | 5 #include "chrome/browser/ui/browser_window_state.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
10 #include "chrome/browser/defaults.h" | 10 #include "chrome/browser/defaults.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 DCHECK(bounds); | 84 DCHECK(bounds); |
85 DCHECK(show_state); | 85 DCHECK(show_state); |
86 *bounds = browser->override_bounds(); | 86 *bounds = browser->override_bounds(); |
87 WindowSizer::GetBrowserWindowBoundsAndShowState(browser->app_name(), | 87 WindowSizer::GetBrowserWindowBoundsAndShowState(browser->app_name(), |
88 *bounds, | 88 *bounds, |
89 browser, | 89 browser, |
90 bounds, | 90 bounds, |
91 show_state); | 91 show_state); |
92 | 92 |
93 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); | 93 const CommandLine& parsed_command_line = *CommandLine::ForCurrentProcess(); |
94 bool record_mode = parsed_command_line.HasSwitch(switches::kRecordMode); | |
Matt Perry
2013/08/02 21:19:08
This is used outside the record API. Please revert
pals
2013/08/05 05:35:55
Done. Oops, thought of removing this change before
| |
95 bool playback_mode = parsed_command_line.HasSwitch(switches::kPlaybackMode); | 94 bool playback_mode = parsed_command_line.HasSwitch(switches::kPlaybackMode); |
96 if (record_mode || playback_mode) { | 95 if (playback_mode) { |
97 // In playback/record mode we always fix the size of the browser and | 96 // In playback mode we always fix the size of the browser and |
98 // move it to (0,0). The reason for this is two reasons: First we want | 97 // move it to (0,0). The reason for this is two reasons: First we want |
99 // resize/moves in the playback to still work, and Second we want | 98 // resize/moves in the playback to still work, and Second we want |
100 // playbacks to work (as much as possible) on machines w/ different | 99 // playbacks to work (as much as possible) on machines w/ different |
101 // screen sizes. | 100 // screen sizes. |
102 *bounds = gfx::Rect(0, 0, 800, 600); | 101 *bounds = gfx::Rect(0, 0, 800, 600); |
103 } | 102 } |
104 | 103 |
105 // The following options override playback/record. | 104 // The following options override playback. |
106 if (parsed_command_line.HasSwitch(switches::kWindowSize)) { | 105 if (parsed_command_line.HasSwitch(switches::kWindowSize)) { |
107 std::string str = | 106 std::string str = |
108 parsed_command_line.GetSwitchValueASCII(switches::kWindowSize); | 107 parsed_command_line.GetSwitchValueASCII(switches::kWindowSize); |
109 int width, height; | 108 int width, height; |
110 if (ParseCommaSeparatedIntegers(str, &width, &height)) | 109 if (ParseCommaSeparatedIntegers(str, &width, &height)) |
111 bounds->set_size(gfx::Size(width, height)); | 110 bounds->set_size(gfx::Size(width, height)); |
112 } | 111 } |
113 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) { | 112 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) { |
114 std::string str = | 113 std::string str = |
115 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition); | 114 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition); |
116 int x, y; | 115 int x, y; |
117 if (ParseCommaSeparatedIntegers(str, &x, &y)) | 116 if (ParseCommaSeparatedIntegers(str, &x, &y)) |
118 bounds->set_origin(gfx::Point(x, y)); | 117 bounds->set_origin(gfx::Point(x, y)); |
119 } | 118 } |
120 } | 119 } |
121 | 120 |
122 } // namespace chrome | 121 } // namespace chrome |
OLD | NEW |