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_PROTECTOR_BASE_SETTING_CHANGE_H_ | 5 #ifndef CHROME_BROWSER_PROTECTOR_BASE_SETTING_CHANGE_H_ |
6 #define CHROME_BROWSER_PROTECTOR_BASE_SETTING_CHANGE_H_ | 6 #define CHROME_BROWSER_PROTECTOR_BASE_SETTING_CHANGE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
48 // Returns true if |this| is a result of merging some changes with |other|. | 48 // Returns true if |this| is a result of merging some changes with |other|. |
49 virtual bool Contains(const BaseSettingChange* other) const; | 49 virtual bool Contains(const BaseSettingChange* other) const; |
50 | 50 |
51 // Applies initial actions to the setting if needed. Must be called before | 51 // Applies initial actions to the setting if needed. Must be called before |
52 // any other calls are made, including text getters. | 52 // any other calls are made, including text getters. |
53 // Returns true if initialization was successful. | 53 // Returns true if initialization was successful. |
54 // Associates this change with |profile| instance so overrides must call the | 54 // Associates this change with |profile| instance so overrides must call the |
55 // base method. | 55 // base method. |
56 virtual bool Init(Profile* profile); | 56 virtual bool Init(Profile* profile); |
57 | 57 |
58 // Called instead of Init when ProtectorService is disabled. No other members | |
59 // are called in that case. | |
60 virtual void InitWhenDisabled(Profile* profile); | |
sky
2012/04/13 19:25:13
It feels error prone to have the two distinct Init
Ivan Korotkov
2012/04/13 20:16:38
I specifically made them distinct functions becaus
| |
61 | |
58 // Persists new setting if needed. |browser| is the Browser instance from | 62 // Persists new setting if needed. |browser| is the Browser instance from |
59 // which the user action originates. | 63 // which the user action originates. |
60 virtual void Apply(Browser* browser); | 64 virtual void Apply(Browser* browser); |
61 | 65 |
62 // Restores old setting if needed. |browser| is the Browser instance from | 66 // Restores old setting if needed. |browser| is the Browser instance from |
63 // which the user action originates. | 67 // which the user action originates. |
64 virtual void Discard(Browser* browser); | 68 virtual void Discard(Browser* browser); |
65 | 69 |
66 // Indicates that user has ignored this change and timeout has passed. | 70 // Indicates that user has ignored this change and timeout has passed. |
67 virtual void Timeout(); | 71 virtual void Timeout(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
138 const SessionStartupPref& backup_startup_pref, | 142 const SessionStartupPref& backup_startup_pref, |
139 const PinnedTabCodec::Tabs& backup_pinned_tabs); | 143 const PinnedTabCodec::Tabs& backup_pinned_tabs); |
140 | 144 |
141 // Allocates and initializes BaseSettingChange implementation for an unknown | 145 // Allocates and initializes BaseSettingChange implementation for an unknown |
142 // preferences change with invalid backup. | 146 // preferences change with invalid backup. |
143 BaseSettingChange* CreatePrefsBackupInvalidChange(); | 147 BaseSettingChange* CreatePrefsBackupInvalidChange(); |
144 | 148 |
145 } // namespace protector | 149 } // namespace protector |
146 | 150 |
147 #endif // CHROME_BROWSER_PROTECTOR_BASE_SETTING_CHANGE_H_ | 151 #endif // CHROME_BROWSER_PROTECTOR_BASE_SETTING_CHANGE_H_ |
OLD | NEW |