| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/prefs/pref_service.h" | |
| 12 #include "base/prefs/scoped_user_pref_update.h" | |
| 13 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 14 #include "chrome/browser/defaults.h" | 12 #include "chrome/browser/defaults.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/sessions/session_service.h" | 14 #include "chrome/browser/sessions/session_service.h" |
| 17 #include "chrome/browser/sessions/session_service_factory.h" | 15 #include "chrome/browser/sessions/session_service_factory.h" |
| 18 #include "chrome/browser/ui/browser.h" | 16 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/window_sizer/window_sizer.h" | 17 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
| 20 #include "chrome/common/chrome_switches.h" | 18 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/pref_names.h" | 19 #include "chrome/common/pref_names.h" |
| 20 #include "components/prefs/pref_service.h" |
| 21 #include "components/prefs/scoped_user_pref_update.h" |
| 22 | 22 |
| 23 namespace chrome { | 23 namespace chrome { |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 // Parse two comma-separated integers from str. Return true on success. | 26 // Parse two comma-separated integers from str. Return true on success. |
| 27 bool ParseCommaSeparatedIntegers(const std::string& str, | 27 bool ParseCommaSeparatedIntegers(const std::string& str, |
| 28 int* ret_num1, | 28 int* ret_num1, |
| 29 int* ret_num2) { | 29 int* ret_num2) { |
| 30 size_t num1_size = str.find_first_of(','); | 30 size_t num1_size = str.find_first_of(','); |
| 31 if (num1_size == std::string::npos) | 31 if (num1_size == std::string::npos) |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) { | 161 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) { |
| 162 std::string str = | 162 std::string str = |
| 163 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition); | 163 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition); |
| 164 int x, y; | 164 int x, y; |
| 165 if (ParseCommaSeparatedIntegers(str, &x, &y)) | 165 if (ParseCommaSeparatedIntegers(str, &x, &y)) |
| 166 bounds->set_origin(gfx::Point(x, y)); | 166 bounds->set_origin(gfx::Point(x, y)); |
| 167 } | 167 } |
| 168 } | 168 } |
| 169 | 169 |
| 170 } // namespace chrome | 170 } // namespace chrome |
| OLD | NEW |