OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ |
6 #define CHROME_BROWSER_UI_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ | 6 #define CHROME_BROWSER_UI_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #import <Cocoa/Cocoa.h> | 9 #import <Cocoa/Cocoa.h> |
10 | 10 |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
12 #include "chrome/browser/plugin_data_remover_helper.h" | |
13 #include "chrome/browser/prefs/pref_member.h" | |
12 | 14 |
13 class BrowsingDataRemover; | 15 class BrowsingDataRemover; |
14 class ClearBrowsingObserver; | 16 class ClearBrowsingObserver; |
17 class PluginDataRemoverHelper; | |
15 class Profile; | 18 class Profile; |
16 @class ThrobberView; | 19 @class ThrobberView; |
17 | 20 |
21 namespace clear_browsing_data_controller_internal { | |
22 class PrefObserverBridge; | |
23 } | |
24 | |
18 // Name of notification that is called when data is cleared. | 25 // Name of notification that is called when data is cleared. |
19 extern NSString* const kClearBrowsingDataControllerDidDelete; | 26 extern NSString* const kClearBrowsingDataControllerDidDelete; |
20 // A key in the above notification's userInfo. Contains a NSNumber with the | 27 // A key in the above notification's userInfo. Contains a NSNumber with the |
21 // logically-ored constants defined in BrowsingDataRemover for the removal. | 28 // logically-ored constants defined in BrowsingDataRemover for the removal. |
22 extern NSString* const kClearBrowsingDataControllerRemoveMask; | 29 extern NSString* const kClearBrowsingDataControllerRemoveMask; |
23 | 30 |
24 // A window controller for managing the "Clear Browsing Data" feature. Modally | 31 // A window controller for managing the "Clear Browsing Data" feature. Modally |
25 // presents a dialog offering the user a set of choices of what browsing data | 32 // presents a dialog offering the user a set of choices of what browsing data |
26 // to delete and does so if the user chooses. | 33 // to delete and does so if the user chooses. |
27 | 34 |
28 @interface ClearBrowsingDataController : NSWindowController { | 35 @interface ClearBrowsingDataController : NSWindowController { |
29 @private | 36 @private |
30 Profile* profile_; // Weak, owned by browser. | 37 Profile* profile_; // Weak, owned by browser. |
31 // If non-null means there is a removal in progress. Member used mainly for | 38 // If non-null means there is a removal in progress. Member used mainly for |
32 // automated tests. The remove deletes itself when it's done, so this is a | 39 // automated tests. The remove deletes itself when it's done, so this is a |
33 // weak reference. | 40 // weak reference. |
34 BrowsingDataRemover* remover_; | 41 BrowsingDataRemover* remover_; |
35 scoped_ptr<ClearBrowsingObserver> observer_; | 42 scoped_ptr<ClearBrowsingObserver> observer_; |
36 BOOL isClearing_; // YES while clearing data is ongoing. | 43 BOOL isClearing_; // YES while clearing data is ongoing. |
44 scoped_ptr<clear_browsing_data_controller_internal::PrefObserverBridge> | |
45 prefObserver_; | |
46 PluginDataRemoverHelper clearLSODataEnabled_; | |
Nico
2010/12/21 23:38:42
Style guide says: Only capitalize the first letter
| |
37 | 47 |
38 // Values for checkboxes, kept in sync with bindings. These values get | 48 // Values for checkboxes, kept in sync with bindings. These values get |
39 // persisted into prefs if the user accepts the dialog. | 49 // persisted into prefs if the user accepts the dialog. |
40 BOOL clearBrowsingHistory_; | 50 BOOL clearBrowsingHistory_; |
41 BOOL clearDownloadHistory_; | 51 BOOL clearDownloadHistory_; |
42 BOOL emptyCache_; | 52 BOOL emptyCache_; |
43 BOOL deleteCookies_; | 53 BOOL deleteCookies_; |
44 BOOL clearSavedPasswords_; | 54 BOOL clearSavedPasswords_; |
55 BOOL clearLSOData_; | |
45 BOOL clearFormData_; | 56 BOOL clearFormData_; |
46 NSInteger timePeriod_; | 57 NSInteger timePeriod_; |
47 } | 58 } |
48 | 59 |
49 // Show the clear browsing data window. Do not use |-initWithProfile:|, | 60 // Show the clear browsing data window. Do not use |-initWithProfile:|, |
50 // go through this instead so we don't end up with multiple instances. | 61 // go through this instead so we don't end up with multiple instances. |
51 // This function does not block, so it can be used from DOMUI calls. | 62 // This function does not block, so it can be used from DOMUI calls. |
52 + (void)showClearBrowsingDialogForProfile:(Profile*)profile; | 63 + (void)showClearBrowsingDialogForProfile:(Profile*)profile; |
53 + (ClearBrowsingDataController*)controllerForProfile:(Profile*)profile; | 64 + (ClearBrowsingDataController*)controllerForProfile:(Profile*)profile; |
54 | 65 |
55 // Run the dialog with an application-modal event loop. If the user accepts, | 66 // Run the dialog with an application-modal event loop. If the user accepts, |
56 // performs the deletion of the selected browsing data. The values of the | 67 // performs the deletion of the selected browsing data. The values of the |
57 // checkboxes will be persisted into prefs for next time. | 68 // checkboxes will be persisted into prefs for next time. |
58 - (void)runModalDialog; | 69 - (void)runModalDialog; |
59 | 70 |
60 // IBActions for the dialog buttons | 71 // IBActions for the dialog buttons |
61 - (IBAction)clearData:(id)sender; | 72 - (IBAction)clearData:(id)sender; |
62 - (IBAction)cancel:(id)sender; | 73 - (IBAction)cancel:(id)sender; |
63 - (IBAction)openFlashPlayerSettings:(id)sender; | 74 - (IBAction)openFlashPlayerSettings:(id)sender; |
64 | 75 |
65 // Properties for bindings | 76 // Properties for bindings |
66 @property (nonatomic) BOOL clearBrowsingHistory; | 77 @property (nonatomic) BOOL clearBrowsingHistory; |
67 @property (nonatomic) BOOL clearDownloadHistory; | 78 @property (nonatomic) BOOL clearDownloadHistory; |
68 @property (nonatomic) BOOL emptyCache; | 79 @property (nonatomic) BOOL emptyCache; |
69 @property (nonatomic) BOOL deleteCookies; | 80 @property (nonatomic) BOOL deleteCookies; |
70 @property (nonatomic) BOOL clearSavedPasswords; | 81 @property (nonatomic) BOOL clearSavedPasswords; |
82 @property (readonly, nonatomic) BOOL clearLSODataEnabled; | |
83 @property (readonly, nonatomic) NSString* clearLSODataMessage; | |
84 @property (nonatomic) BOOL clearLSOData; | |
85 // The checkbox is checked when |clearLSOData| and |clearLSODataEnabled| | |
86 // both are YES. | |
87 @property (nonatomic) BOOL clearLSODataCheckbox; | |
Nico
2010/12/21 23:38:42
|clearLsoDataChecked|?
Bernhard Bauer
2010/12/22 03:40:05
Makes sense (except for the capitalization part. T
| |
71 @property (nonatomic) BOOL clearFormData; | 88 @property (nonatomic) BOOL clearFormData; |
72 @property (nonatomic) NSInteger timePeriod; | 89 @property (nonatomic) NSInteger timePeriod; |
73 @property (nonatomic) BOOL isClearing; | 90 @property (nonatomic) BOOL isClearing; |
74 | 91 |
75 @end | 92 @end |
76 | 93 |
77 | 94 |
78 @interface ClearBrowsingDataController (ExposedForUnitTests) | 95 @interface ClearBrowsingDataController (ExposedForUnitTests) |
79 // Create the controller with the given profile (which must not be NULL). | 96 // Create the controller with the given profile (which must not be NULL). |
80 - (id)initWithProfile:(Profile*)profile; | 97 - (id)initWithProfile:(Profile*)profile; |
81 @property (readonly) int removeMask; | 98 @property (readonly) int removeMask; |
82 - (void)persistToPrefs; | 99 - (void)persistToPrefs; |
83 - (void)closeDialog; | 100 - (void)closeDialog; |
84 - (void)dataRemoverDidFinish; | 101 - (void)dataRemoverDidFinish; |
85 @end | 102 @end |
86 | 103 |
87 #endif // CHROME_BROWSER_UI_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ | 104 #endif // CHROME_BROWSER_UI_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ |
OLD | NEW |