Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: chrome/browser/ui/browser_window_state.cc

Issue 2251263003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/autofill/chrome_autofill_client.cc ('k') | chrome/browser/ui/cocoa/extensions/extension_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698