| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 class WindowPlacementPrefUpdate : public DictionaryPrefUpdate { | 44 class WindowPlacementPrefUpdate : public DictionaryPrefUpdate { |
| 45 public: | 45 public: |
| 46 WindowPlacementPrefUpdate(PrefService* service, | 46 WindowPlacementPrefUpdate(PrefService* service, |
| 47 const std::string& window_name) | 47 const std::string& window_name) |
| 48 : DictionaryPrefUpdate(service, prefs::kAppWindowPlacement), | 48 : DictionaryPrefUpdate(service, prefs::kAppWindowPlacement), |
| 49 window_name_(window_name) {} | 49 window_name_(window_name) {} |
| 50 | 50 |
| 51 virtual ~WindowPlacementPrefUpdate() {} | 51 virtual ~WindowPlacementPrefUpdate() {} |
| 52 | 52 |
| 53 virtual base::DictionaryValue* Get() OVERRIDE { | 53 virtual base::DictionaryValue* Get() override { |
| 54 base::DictionaryValue* all_apps_dict = DictionaryPrefUpdate::Get(); | 54 base::DictionaryValue* all_apps_dict = DictionaryPrefUpdate::Get(); |
| 55 base::DictionaryValue* this_app_dict = NULL; | 55 base::DictionaryValue* this_app_dict = NULL; |
| 56 if (!all_apps_dict->GetDictionary(window_name_, &this_app_dict)) { | 56 if (!all_apps_dict->GetDictionary(window_name_, &this_app_dict)) { |
| 57 this_app_dict = new base::DictionaryValue; | 57 this_app_dict = new base::DictionaryValue; |
| 58 all_apps_dict->Set(window_name_, this_app_dict); | 58 all_apps_dict->Set(window_name_, this_app_dict); |
| 59 } | 59 } |
| 60 return this_app_dict; | 60 return this_app_dict; |
| 61 } | 61 } |
| 62 | 62 |
| 63 private: | 63 private: |
| (...skipping 97 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 |