Chromium Code Reviews| 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/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 63 private: | 63 private: |
| 64 const std::string window_name_; | 64 const std::string window_name_; |
| 65 | 65 |
| 66 DISALLOW_COPY_AND_ASSIGN(WindowPlacementPrefUpdate); | 66 DISALLOW_COPY_AND_ASSIGN(WindowPlacementPrefUpdate); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace | 69 } // namespace |
| 70 | 70 |
| 71 std::string GetWindowName(const Browser* browser) { | 71 std::string GetWindowName(const Browser* browser) { |
| 72 if (browser->app_name().empty()) { | 72 if (browser->app_name().empty()) { |
| 73 return browser->is_type_popup() ? | 73 return prefs::kBrowserWindowPlacementPopup; |
|
rkaplow
2015/02/20 21:58:08
I'm not too sure about this. Can someone with cont
| |
| 74 prefs::kBrowserWindowPlacementPopup : prefs::kBrowserWindowPlacement; | |
| 75 } | 74 } |
| 76 return browser->app_name(); | 75 return browser->app_name(); |
| 77 } | 76 } |
| 78 | 77 |
| 79 scoped_ptr<DictionaryPrefUpdate> GetWindowPlacementDictionaryReadWrite( | 78 scoped_ptr<DictionaryPrefUpdate> GetWindowPlacementDictionaryReadWrite( |
| 80 const std::string& window_name, | 79 const std::string& window_name, |
| 81 PrefService* prefs) { | 80 PrefService* prefs) { |
| 82 DCHECK(!window_name.empty()); | 81 DCHECK(!window_name.empty()); |
| 83 // A normal DictionaryPrefUpdate will suffice for non-app windows. | 82 // A normal DictionaryPrefUpdate will suffice for non-app windows. |
| 84 if (prefs->FindPreference(window_name.c_str())) { | 83 if (prefs->FindPreference(window_name.c_str())) { |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 162 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) { | 161 if (parsed_command_line.HasSwitch(switches::kWindowPosition)) { |
| 163 std::string str = | 162 std::string str = |
| 164 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition); | 163 parsed_command_line.GetSwitchValueASCII(switches::kWindowPosition); |
| 165 int x, y; | 164 int x, y; |
| 166 if (ParseCommaSeparatedIntegers(str, &x, &y)) | 165 if (ParseCommaSeparatedIntegers(str, &x, &y)) |
| 167 bounds->set_origin(gfx::Point(x, y)); | 166 bounds->set_origin(gfx::Point(x, y)); |
| 168 } | 167 } |
| 169 } | 168 } |
| 170 | 169 |
| 171 } // namespace chrome | 170 } // namespace chrome |
| OLD | NEW |