| 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 "printing/print_job_constants.h" | 8 #include "printing/print_job_constants.h" |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 | 13 |
| 14 class FilePath; | |
| 15 class PrintPreviewHandlerTest; | 14 class PrintPreviewHandlerTest; |
| 16 class PrefService; | 15 class PrefService; |
| 17 class PrefServiceSyncable; | 16 class PrefServiceSyncable; |
| 18 | 17 |
| 19 namespace base { | 18 namespace base { |
| 20 class DictionaryValue; | 19 class DictionaryValue; |
| 20 class FilePath; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace printing { | 23 namespace printing { |
| 24 | 24 |
| 25 // 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. |
| 26 // 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. |
| 27 // Only one instance of this class is instantiated. | 27 // Only one instance of this class is instantiated. |
| 28 class StickySettings { | 28 class StickySettings { |
| 29 public: | 29 public: |
| 30 StickySettings(); | 30 StickySettings(); |
| 31 ~StickySettings(); | 31 ~StickySettings(); |
| 32 | 32 |
| 33 FilePath* save_path(); | 33 base::FilePath* save_path(); |
| 34 std::string* printer_app_state(); | 34 std::string* printer_app_state(); |
| 35 | 35 |
| 36 // Stores app state for the last used printer. | 36 // Stores app state for the last used printer. |
| 37 void StoreAppState(const std::string& app_state); | 37 void StoreAppState(const std::string& app_state); |
| 38 // Stores the last path the user used to save to pdf. | 38 // Stores the last path the user used to save to pdf. |
| 39 void StoreSavePath(const FilePath& path); | 39 void StoreSavePath(const base::FilePath& path); |
| 40 | 40 |
| 41 void SaveInPrefs(PrefService* profile); | 41 void SaveInPrefs(PrefService* profile); |
| 42 void RestoreFromPrefs(PrefService* profile); | 42 void RestoreFromPrefs(PrefService* profile); |
| 43 static void RegisterUserPrefs(PrefServiceSyncable* prefs); | 43 static void RegisterUserPrefs(PrefServiceSyncable* prefs); |
| 44 private: | 44 private: |
| 45 | 45 |
| 46 scoped_ptr<FilePath> save_path_; | 46 scoped_ptr<base::FilePath> save_path_; |
| 47 scoped_ptr<std::string> printer_app_state_; | 47 scoped_ptr<std::string> printer_app_state_; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 } // namespace printing | 50 } // namespace printing |
| 51 | 51 |
| 52 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_ | 52 #endif // CHROME_BROWSER_UI_WEBUI_PRINT_PREVIEW_STICKY_SETTINGS_H_ |
| OLD | NEW |