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_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ | 5 #ifndef CHROME_BROWSER_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ |
6 #define CHROME_BROWSER_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ | 6 #define CHROME_BROWSER_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 |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 @interface ClearBrowsingDataController : NSWindowController { | 28 @interface ClearBrowsingDataController : NSWindowController { |
29 @private | 29 @private |
30 Profile* profile_; // Weak, owned by browser. | 30 Profile* profile_; // Weak, owned by browser. |
31 // If non-null means there is a removal in progress. Member used mainly for | 31 // 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 | 32 // automated tests. The remove deletes itself when it's done, so this is a |
33 // weak reference. | 33 // weak reference. |
34 BrowsingDataRemover* remover_; | 34 BrowsingDataRemover* remover_; |
35 scoped_ptr<ClearBrowsingObserver> observer_; | 35 scoped_ptr<ClearBrowsingObserver> observer_; |
36 BOOL isClearing_; // YES while clearing data is ongoing. | 36 BOOL isClearing_; // YES while clearing data is ongoing. |
37 NSString* clearingStatus_; | |
38 | |
39 IBOutlet NSTabView* tabView_; | |
40 IBOutlet NSView* otherDataTab_; | |
41 IBOutlet NSArray* objectsToVerticallySize_; | |
42 | 37 |
43 // Values for checkboxes, kept in sync with bindings. These values get | 38 // Values for checkboxes, kept in sync with bindings. These values get |
44 // persisted into prefs if the user accepts the dialog. | 39 // persisted into prefs if the user accepts the dialog. |
45 BOOL clearBrowsingHistory_; | 40 BOOL clearBrowsingHistory_; |
46 BOOL clearDownloadHistory_; | 41 BOOL clearDownloadHistory_; |
47 BOOL emptyCache_; | 42 BOOL emptyCache_; |
48 BOOL deleteCookies_; | 43 BOOL deleteCookies_; |
49 BOOL clearSavedPasswords_; | 44 BOOL clearSavedPasswords_; |
50 BOOL clearFormData_; | 45 BOOL clearFormData_; |
51 NSInteger timePeriod_; | 46 NSInteger timePeriod_; |
52 } | 47 } |
53 | 48 |
54 // Show the clear browsing data window. Do not use |-initWithProfile:|, | 49 // Show the clear browsing data window. Do not use |-initWithProfile:|, |
55 // go through this instead so we don't end up with multiple instances. | 50 // go through this instead so we don't end up with multiple instances. |
56 // This function does not block, so it can be used from DOMUI calls. | 51 // This function does not block, so it can be used from DOMUI calls. |
57 + (void)showClearBrowsingDialogForProfile:(Profile*)profile; | 52 + (void)showClearBrowsingDialogForProfile:(Profile*)profile; |
58 + (ClearBrowsingDataController*)controllerForProfile:(Profile*)profile; | 53 + (ClearBrowsingDataController*)controllerForProfile:(Profile*)profile; |
59 | 54 |
60 // Run the dialog with an application-modal event loop. If the user accepts, | 55 // Run the dialog with an application-modal event loop. If the user accepts, |
61 // performs the deletion of the selected browsing data. The values of the | 56 // performs the deletion of the selected browsing data. The values of the |
62 // checkboxes will be persisted into prefs for next time. | 57 // checkboxes will be persisted into prefs for next time. |
63 - (void)runModalDialog; | 58 - (void)runModalDialog; |
64 | 59 |
65 // IBActions for the dialog buttons | 60 // IBActions for the dialog buttons |
66 - (IBAction)clearData:(id)sender; | 61 - (IBAction)clearData:(id)sender; |
67 - (IBAction)cancel:(id)sender; | 62 - (IBAction)cancel:(id)sender; |
68 | |
69 - (IBAction)openFlashPlayerSettings:(id)sender; | 63 - (IBAction)openFlashPlayerSettings:(id)sender; |
70 - (IBAction)stopSyncAndDeleteData:(id)sender; | |
71 - (IBAction)openGoogleDashboard:(id)sender; | |
72 | 64 |
73 // Properties for bindings | 65 // Properties for bindings |
74 @property (nonatomic) BOOL clearBrowsingHistory; | 66 @property (nonatomic) BOOL clearBrowsingHistory; |
75 @property (nonatomic) BOOL clearDownloadHistory; | 67 @property (nonatomic) BOOL clearDownloadHistory; |
76 @property (nonatomic) BOOL emptyCache; | 68 @property (nonatomic) BOOL emptyCache; |
77 @property (nonatomic) BOOL deleteCookies; | 69 @property (nonatomic) BOOL deleteCookies; |
78 @property (nonatomic) BOOL clearSavedPasswords; | 70 @property (nonatomic) BOOL clearSavedPasswords; |
79 @property (nonatomic) BOOL clearFormData; | 71 @property (nonatomic) BOOL clearFormData; |
80 @property (nonatomic) NSInteger timePeriod; | 72 @property (nonatomic) NSInteger timePeriod; |
81 @property (nonatomic) BOOL isClearing; | 73 @property (nonatomic) BOOL isClearing; |
82 @property (nonatomic, copy) NSString* clearingStatus; | |
83 @property (readonly, nonatomic) BOOL isSyncEnabled; | |
84 | |
85 @property (readonly) NSFont* labelFont; | |
86 | 74 |
87 @end | 75 @end |
88 | 76 |
89 | 77 |
90 @interface ClearBrowsingDataController (ExposedForUnitTests) | 78 @interface ClearBrowsingDataController (ExposedForUnitTests) |
91 // Create the controller with the given profile (which must not be NULL). | 79 // Create the controller with the given profile (which must not be NULL). |
92 - (id)initWithProfile:(Profile*)profile; | 80 - (id)initWithProfile:(Profile*)profile; |
93 @property (readonly) int removeMask; | 81 @property (readonly) int removeMask; |
94 - (void)persistToPrefs; | 82 - (void)persistToPrefs; |
95 - (void)closeDialog; | 83 - (void)closeDialog; |
96 - (void)dataRemoverDidFinish; | 84 - (void)dataRemoverDidFinish; |
97 @end | 85 @end |
98 | 86 |
99 #endif // CHROME_BROWSER_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ | 87 #endif // CHROME_BROWSER_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ |
OLD | NEW |