| 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 |
| 11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
| 12 | 12 |
| 13 class BrowsingDataRemover; | 13 class BrowsingDataRemover; |
| 14 class ClearBrowsingObserver; | 14 class ClearBrowsingObserver; |
| 15 class Profile; | 15 class Profile; |
| 16 class ProfileSyncService; | |
| 17 @class ThrobberView; | 16 @class ThrobberView; |
| 18 | 17 |
| 19 // Name of notification that is called when data is cleared. | 18 // Name of notification that is called when data is cleared. |
| 20 extern NSString* const kClearBrowsingDataControllerDidDelete; | 19 extern NSString* const kClearBrowsingDataControllerDidDelete; |
| 21 // A key in the above notification's userInfo. Contains a NSNumber with the | 20 // A key in the above notification's userInfo. Contains a NSNumber with the |
| 22 // logically-ored constants defined in BrowsingDataRemover for the removal. | 21 // logically-ored constants defined in BrowsingDataRemover for the removal. |
| 23 extern NSString* const kClearBrowsingDataControllerRemoveMask; | 22 extern NSString* const kClearBrowsingDataControllerRemoveMask; |
| 24 | 23 |
| 25 // A window controller for managing the "Clear Browsing Data" feature. Modally | 24 // A window controller for managing the "Clear Browsing Data" feature. Modally |
| 26 // presents a dialog offering the user a set of choices of what browsing data | 25 // presents a dialog offering the user a set of choices of what browsing data |
| 27 // to delete and does so if the user chooses. | 26 // to delete and does so if the user chooses. |
| 28 | 27 |
| 29 @interface ClearBrowsingDataController : NSWindowController { | 28 @interface ClearBrowsingDataController : NSWindowController { |
| 30 @private | 29 @private |
| 31 Profile* profile_; // Weak, owned by browser. | 30 Profile* profile_; // Weak, owned by browser. |
| 32 // 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 |
| 33 // 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 |
| 34 // weak reference. | 33 // weak reference. |
| 35 BrowsingDataRemover* remover_; | 34 BrowsingDataRemover* remover_; |
| 36 ProfileSyncService* sync_service_; | |
| 37 scoped_ptr<ClearBrowsingObserver> observer_; | 35 scoped_ptr<ClearBrowsingObserver> observer_; |
| 38 BOOL isClearing_; // YES while clearing data is ongoing. | 36 BOOL isClearing_; // YES while clearing data is ongoing. |
| 39 NSString* clearingStatus_; | 37 NSString* clearingStatus_; |
| 40 | 38 |
| 41 IBOutlet NSTabView* tabView_; | 39 IBOutlet NSTabView* tabView_; |
| 42 IBOutlet NSView* otherDataTab_; | 40 IBOutlet NSView* otherDataTab_; |
| 43 IBOutlet NSArray* objectsToVerticallySize_; | 41 IBOutlet NSArray* objectsToVerticallySize_; |
| 44 | 42 |
| 45 // Values for checkboxes, kept in sync with bindings. These values get | 43 // Values for checkboxes, kept in sync with bindings. These values get |
| 46 // persisted into prefs if the user accepts the dialog. | 44 // persisted into prefs if the user accepts the dialog. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 75 // Properties for bindings | 73 // Properties for bindings |
| 76 @property (nonatomic) BOOL clearBrowsingHistory; | 74 @property (nonatomic) BOOL clearBrowsingHistory; |
| 77 @property (nonatomic) BOOL clearDownloadHistory; | 75 @property (nonatomic) BOOL clearDownloadHistory; |
| 78 @property (nonatomic) BOOL emptyCache; | 76 @property (nonatomic) BOOL emptyCache; |
| 79 @property (nonatomic) BOOL deleteCookies; | 77 @property (nonatomic) BOOL deleteCookies; |
| 80 @property (nonatomic) BOOL clearSavedPasswords; | 78 @property (nonatomic) BOOL clearSavedPasswords; |
| 81 @property (nonatomic) BOOL clearFormData; | 79 @property (nonatomic) BOOL clearFormData; |
| 82 @property (nonatomic) NSInteger timePeriod; | 80 @property (nonatomic) NSInteger timePeriod; |
| 83 @property (nonatomic) BOOL isClearing; | 81 @property (nonatomic) BOOL isClearing; |
| 84 @property (nonatomic, copy) NSString* clearingStatus; | 82 @property (nonatomic, copy) NSString* clearingStatus; |
| 85 @property (readonly, nonatomic) BOOL isSyncVisible; | |
| 86 @property (readonly, nonatomic) BOOL isSyncEnabled; | 83 @property (readonly, nonatomic) BOOL isSyncEnabled; |
| 87 | 84 |
| 88 @property (readonly) NSFont* labelFont; | 85 @property (readonly) NSFont* labelFont; |
| 89 | 86 |
| 90 @end | 87 @end |
| 91 | 88 |
| 92 | 89 |
| 93 @interface ClearBrowsingDataController (ExposedForUnitTests) | 90 @interface ClearBrowsingDataController (ExposedForUnitTests) |
| 94 // Create the controller with the given profile (which must not be NULL). | 91 // Create the controller with the given profile (which must not be NULL). |
| 95 - (id)initWithProfile:(Profile*)profile; | 92 - (id)initWithProfile:(Profile*)profile; |
| 96 @property (readonly) int removeMask; | 93 @property (readonly) int removeMask; |
| 97 - (void)persistToPrefs; | 94 - (void)persistToPrefs; |
| 98 - (void)closeDialog; | 95 - (void)closeDialog; |
| 99 - (void)dataRemoverDidFinish; | 96 - (void)dataRemoverDidFinish; |
| 100 @end | 97 @end |
| 101 | 98 |
| 102 #endif // CHROME_BROWSER_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ | 99 #endif // CHROME_BROWSER_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ |
| OLD | NEW |