Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_REMOVAL_CONTROLLER _H_ | |
| 6 #define IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_REMOVAL_CONTROLLER _H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 // Controls the removal of extra browser states. | |
| 11 class ChromeBrowserStateRemovalController { | |
| 12 public: | |
| 13 static ChromeBrowserStateRemovalController* GetInstance(); | |
| 14 | |
| 15 // Removes the browser states marked as not to keep if they exist. It also | |
| 16 // converts the most recently used bookmarks file to an HTML representation. | |
| 17 void RemoveBrowserStatesIfNecessary(); | |
| 18 | |
| 19 // Returns whether a browser state has been removed. The value is conserved | |
| 20 // across application restarts. | |
| 21 bool HasBrowserStateBeenRemoved(); | |
| 22 | |
| 23 // Returns the GAIA Id of the removed browser state if it was authenticated. | |
| 24 // The value should not be trusted unless HasBrowserStateBeenRemoved() returns | |
| 25 // true. | |
| 26 const std::string& GetRemovedBrowserStateGAIAId() const { | |
|
droger
2016/02/04 13:56:14
Optional: style for inlined method names.
sdefresne
2016/02/04 15:27:41
Done.
| |
| 27 return removed_browser_state_gaia_id_; | |
| 28 } | |
| 29 | |
| 30 // Returns whether the last used browser sate was changed during this session. | |
| 31 bool HasChangedLastUsedBrowserState() const { | |
|
droger
2016/02/04 13:56:14
Optional: style for inlined method names.
sdefresne
2016/02/04 15:27:41
Done.
| |
| 32 return has_changed_last_used_browser_state_; | |
| 33 } | |
| 34 | |
| 35 private: | |
| 36 ChromeBrowserStateRemovalController(); | |
| 37 ~ChromeBrowserStateRemovalController(); | |
| 38 | |
| 39 // Returns the relative path of the browser state path to keep. This value | |
| 40 // was stored from the user choice. | |
| 41 std::string GetBrowserStatePathToKeep(); | |
| 42 | |
| 43 // Sets whether a browser state has been removed. The value is conserved | |
| 44 // across application restarts. | |
| 45 void SetHasBrowserStateBeenRemoved(bool value); | |
| 46 | |
| 47 // Returns the relative path of the last browser state used (during the | |
| 48 // previous application run). | |
| 49 std::string GetLastBrowserStatePathUsed(); | |
| 50 | |
| 51 // Sets the relative path of the last browser state used. | |
| 52 void SetLastBrowserStatePathUsed(const std::string& browser_state_path); | |
| 53 | |
| 54 // The GAIA Id of the removed browser state (if any). | |
| 55 std::string removed_browser_state_gaia_id_; | |
| 56 | |
| 57 // Whether the last used browser state was changed. | |
| 58 bool has_changed_last_used_browser_state_; | |
| 59 }; | |
| 60 | |
| 61 #endif // IOS_CHROME_BROWSER_BROWSER_STATE_CHROME_BROWSER_STATE_REMOVAL_CONTROL LER_H_ | |
| OLD | NEW |