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