diff options
author | Ben Murdoch <benm@google.com> | 2010-07-29 17:14:53 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2010-08-04 14:29:45 +0100 |
commit | c407dc5cd9bdc5668497f21b26b09d988ab439de (patch) | |
tree | 7eaf8707c0309516bdb042ad976feedaf72b0bb1 /chrome/browser/cocoa/clear_browsing_data_controller.h | |
parent | 0998b1cdac5733f299c12d88bc31ef9c8035b8fa (diff) | |
download | external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.zip external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.gz external_chromium-c407dc5cd9bdc5668497f21b26b09d988ab439de.tar.bz2 |
Merge Chromium src@r53293
Change-Id: Ia79acf8670f385cee48c45b0a75371d8e950af34
Diffstat (limited to 'chrome/browser/cocoa/clear_browsing_data_controller.h')
-rw-r--r-- | chrome/browser/cocoa/clear_browsing_data_controller.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/clear_browsing_data_controller.h b/chrome/browser/cocoa/clear_browsing_data_controller.h new file mode 100644 index 0000000..230fdf4 --- /dev/null +++ b/chrome/browser/cocoa/clear_browsing_data_controller.h @@ -0,0 +1,86 @@ +// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ +#define CHROME_BROWSER_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ + +#import <Cocoa/Cocoa.h> + +#include "base/scoped_ptr.h" + +class BrowsingDataRemover; +class ClearBrowsingObserver; +class Profile; +@class ThrobberView; + +// Name of notification that is called when data is cleared. +extern NSString* const kClearBrowsingDataControllerDidDelete; +// A key in the above notification's userInfo. Contains a NSNumber with the +// logically-ored constants defined in BrowsingDataRemover for the removal. +extern NSString* const kClearBrowsingDataControllerRemoveMask; + +// A window controller for managing the "Clear Browsing Data" feature. Modally +// presents a dialog offering the user a set of choices of what browsing data +// to delete and does so if the user chooses. + +@interface ClearBrowsingDataController : NSWindowController { + @private + Profile* profile_; // Weak, owned by browser. + // If non-null means there is a removal in progress. Member used mainly for + // automated tests. The remove deletes itself when it's done, so this is a + // weak reference. + BrowsingDataRemover* remover_; + scoped_ptr<ClearBrowsingObserver> observer_; + BOOL isClearing_; // YES while clearing data is ongoing. + + // Values for checkboxes, kept in sync with bindings. These values get + // persisted into prefs if the user accepts the dialog. + BOOL clearBrowsingHistory_; + BOOL clearDownloadHistory_; + BOOL emptyCache_; + BOOL deleteCookies_; + BOOL clearSavedPasswords_; + BOOL clearFormData_; + NSInteger timePeriod_; +} + +// Show the clear browsing data window. Do not use |-initWithProfile:|, +// go through this instead so we don't end up with multiple instances. +// This function does not block, so it can be used from DOMUI calls. ++ (void)showClearBrowsingDialogForProfile:(Profile*)profile; ++ (ClearBrowsingDataController*)controllerForProfile:(Profile*)profile; + +// Run the dialog with an application-modal event loop. If the user accepts, +// performs the deletion of the selected browsing data. The values of the +// checkboxes will be persisted into prefs for next time. +- (void)runModalDialog; + +// IBActions for the dialog buttons +- (IBAction)clearData:(id)sender; +- (IBAction)cancel:(id)sender; +- (IBAction)openFlashPlayerSettings:(id)sender; + +// Properties for bindings +@property (nonatomic) BOOL clearBrowsingHistory; +@property (nonatomic) BOOL clearDownloadHistory; +@property (nonatomic) BOOL emptyCache; +@property (nonatomic) BOOL deleteCookies; +@property (nonatomic) BOOL clearSavedPasswords; +@property (nonatomic) BOOL clearFormData; +@property (nonatomic) NSInteger timePeriod; +@property (nonatomic) BOOL isClearing; + +@end + + +@interface ClearBrowsingDataController (ExposedForUnitTests) +// Create the controller with the given profile (which must not be NULL). +- (id)initWithProfile:(Profile*)profile; +@property (readonly) int removeMask; +- (void)persistToPrefs; +- (void)closeDialog; +- (void)dataRemoverDidFinish; +@end + +#endif // CHROME_BROWSER_COCOA_CLEAR_BROWSING_DATA_CONTROLLER_ |