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

Side by Side Diff: chrome/browser/ui/webui/print_preview/sticky_settings.cc

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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/webui/print_preview/sticky_settings.h" 5 #include "chrome/browser/ui/webui/print_preview/sticky_settings.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/values.h" 9 #include "base/values.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 16 matching lines...) Expand all
27 printer_app_state_.reset(new std::string(data)); 27 printer_app_state_.reset(new std::string(data));
28 } 28 }
29 29
30 void StickySettings::StoreSavePath(const base::FilePath& path) { 30 void StickySettings::StoreSavePath(const base::FilePath& path) {
31 save_path_.reset(new base::FilePath(path)); 31 save_path_.reset(new base::FilePath(path));
32 } 32 }
33 33
34 void StickySettings::SaveInPrefs(PrefService* prefs) { 34 void StickySettings::SaveInPrefs(PrefService* prefs) {
35 DCHECK(prefs); 35 DCHECK(prefs);
36 if (prefs) { 36 if (prefs) {
37 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue); 37 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue);
38 if (save_path_.get()) 38 if (save_path_.get())
39 value->SetString(printing::kSettingSavePath, save_path_->value()); 39 value->SetString(printing::kSettingSavePath, save_path_->value());
40 if (printer_app_state_.get()) 40 if (printer_app_state_.get())
41 value->SetString(printing::kSettingAppState, 41 value->SetString(printing::kSettingAppState,
42 *printer_app_state_); 42 *printer_app_state_);
43 prefs->Set(prefs::kPrintPreviewStickySettings, *value); 43 prefs->Set(prefs::kPrintPreviewStickySettings, *value);
44 } 44 }
45 } 45 }
46 46
47 void StickySettings::RestoreFromPrefs(PrefService* prefs) { 47 void StickySettings::RestoreFromPrefs(PrefService* prefs) {
(...skipping 18 matching lines...) Expand all
66 66
67 std::string* StickySettings::printer_app_state() { 67 std::string* StickySettings::printer_app_state() {
68 return printer_app_state_.get(); 68 return printer_app_state_.get();
69 } 69 }
70 70
71 base::FilePath* StickySettings::save_path() { 71 base::FilePath* StickySettings::save_path() {
72 return save_path_.get(); 72 return save_path_.get();
73 } 73 }
74 74
75 } // namespace printing 75 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/print_preview/sticky_settings.h ('k') | chrome/browser/ui/webui/profiler_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698