| 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" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 return browser->app_name(); | 80 return browser->app_name(); |
| 81 } | 81 } |
| 82 | 82 |
| 83 std::unique_ptr<DictionaryPrefUpdate> GetWindowPlacementDictionaryReadWrite( | 83 std::unique_ptr<DictionaryPrefUpdate> GetWindowPlacementDictionaryReadWrite( |
| 84 const std::string& window_name, | 84 const std::string& window_name, |
| 85 PrefService* prefs) { | 85 PrefService* prefs) { |
| 86 DCHECK(!window_name.empty()); | 86 DCHECK(!window_name.empty()); |
| 87 // A normal DictionaryPrefUpdate will suffice for non-app windows. | 87 // A normal DictionaryPrefUpdate will suffice for non-app windows. |
| 88 if (prefs->FindPreference(window_name.c_str())) { | 88 if (prefs->FindPreference(window_name.c_str())) { |
| 89 return base::WrapUnique( | 89 return base::MakeUnique<DictionaryPrefUpdate>(prefs, window_name.c_str()); |
| 90 new DictionaryPrefUpdate(prefs, window_name.c_str())); | |
| 91 } | 90 } |
| 92 return std::unique_ptr<DictionaryPrefUpdate>( | 91 return std::unique_ptr<DictionaryPrefUpdate>( |
| 93 new WindowPlacementPrefUpdate(prefs, window_name)); | 92 new WindowPlacementPrefUpdate(prefs, window_name)); |
| 94 } | 93 } |
| 95 | 94 |
| 96 const base::DictionaryValue* GetWindowPlacementDictionaryReadOnly( | 95 const base::DictionaryValue* GetWindowPlacementDictionaryReadOnly( |
| 97 const std::string& window_name, | 96 const std::string& window_name, |
| 98 PrefService* prefs) { | 97 PrefService* prefs) { |
| 99 DCHECK(!window_name.empty()); | 98 DCHECK(!window_name.empty()); |
| 100 if (prefs->FindPreference(window_name.c_str())) | 99 if (prefs->FindPreference(window_name.c_str())) |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) { | 168 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) { |
| 170 std::string str = | 169 std::string str = |
| 171 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition); | 170 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition); |
| 172 int x, y; | 171 int x, y; |
| 173 if (ParseCommaSeparatedIntegers(str, &x, &y)) | 172 if (ParseCommaSeparatedIntegers(str, &x, &y)) |
| 174 bounds->set_origin(gfx::Point(x, y)); | 173 bounds->set_origin(gfx::Point(x, y)); |
| 175 } | 174 } |
| 176 } | 175 } |
| 177 | 176 |
| 178 } // namespace chrome | 177 } // namespace chrome |
| OLD | NEW |