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

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

Issue 2139303003: Modified printing to no longer store its own save path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: minor fixes Created 4 years, 5 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 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_ 5 #ifndef CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_
6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_ 6 #define CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "printing/print_job_constants.h" 11 #include "printing/print_job_constants.h"
12 12
13 class PrefService; 13 class PrefService;
14 14
15 namespace base { 15 namespace base {
16 class DictionaryValue; 16 class DictionaryValue;
17 class FilePath;
18 } 17 }
19 18
20 namespace user_prefs { 19 namespace user_prefs {
21 class PrefRegistrySyncable; 20 class PrefRegistrySyncable;
22 } 21 }
23 22
24 namespace printing { 23 namespace printing {
25 24
26 // Holds all the settings that should be remembered (sticky) in print preview. 25 // Holds all the settings that should be remembered (sticky) in print preview.
27 // A sticky setting will be restored next time the user launches print preview. 26 // A sticky setting will be restored next time the user launches print preview.
28 // Only one instance of this class is instantiated. 27 // Only one instance of this class is instantiated.
29 class StickySettings { 28 class StickySettings {
30 public: 29 public:
31 StickySettings(); 30 StickySettings();
32 ~StickySettings(); 31 ~StickySettings();
33 32
34 base::FilePath* save_path();
35 std::string* printer_app_state(); 33 std::string* printer_app_state();
36 34
37 // Stores app state for the last used printer. 35 // Stores app state for the last used printer.
38 void StoreAppState(const std::string& app_state); 36 void StoreAppState(const std::string& app_state);
39 // Stores the last path the user used to save to pdf.
40 void StoreSavePath(const base::FilePath& path);
41 37
42 void SaveInPrefs(PrefService* profile); 38 void SaveInPrefs(PrefService* profile);
43 void RestoreFromPrefs(PrefService* profile); 39 void RestoreFromPrefs(PrefService* profile);
44 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); 40 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
45 41
46 private: 42 private:
47 std::unique_ptr<base::FilePath> save_path_;
48 std::unique_ptr<std::string> printer_app_state_; 43 std::unique_ptr<std::string> printer_app_state_;
49 }; 44 };
50 45
51 } // namespace printing 46 } // namespace printing
52 47
53 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_ 48 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698