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 #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; | 17 class FilePath; |
Lei Zhang
2016/07/13 22:16:09
No longer needed.
| |
18 } | 18 } |
19 | 19 |
20 namespace user_prefs { | 20 namespace user_prefs { |
21 class PrefRegistrySyncable; | 21 class PrefRegistrySyncable; |
22 } | 22 } |
23 | 23 |
24 namespace printing { | 24 namespace printing { |
25 | 25 |
26 // Holds all the settings that should be remembered (sticky) in print preview. | 26 // 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. | 27 // A sticky setting will be restored next time the user launches print preview. |
28 // Only one instance of this class is instantiated. | 28 // Only one instance of this class is instantiated. |
29 class StickySettings { | 29 class StickySettings { |
30 public: | 30 public: |
31 StickySettings(); | 31 StickySettings(); |
32 ~StickySettings(); | 32 ~StickySettings(); |
33 | 33 |
34 base::FilePath* save_path(); | |
35 std::string* printer_app_state(); | 34 std::string* printer_app_state(); |
36 | 35 |
37 // Stores app state for the last used printer. | 36 // Stores app state for the last used printer. |
38 void StoreAppState(const std::string& app_state); | 37 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 | 38 |
42 void SaveInPrefs(PrefService* profile); | 39 void SaveInPrefs(PrefService* profile); |
43 void RestoreFromPrefs(PrefService* profile); | 40 void RestoreFromPrefs(PrefService* profile); |
44 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); | 41 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
45 | 42 |
46 private: | 43 private: |
47 std::unique_ptr<base::FilePath> save_path_; | |
48 std::unique_ptr<std::string> printer_app_state_; | 44 std::unique_ptr<std::string> printer_app_state_; |
49 }; | 45 }; |
50 | 46 |
51 } // namespace printing | 47 } // namespace printing |
52 | 48 |
53 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_ | 49 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_ |
OLD | NEW |