| 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/cocoa_protocols_mac.h" | 9 #include "base/cocoa_protocols_mac.h" |
| 10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 NSTableViewDelegate> { | 21 NSTableViewDelegate> { |
| 22 @private | 22 @private |
| 23 IBOutlet NSTableView* tableView_; | 23 IBOutlet NSTableView* tableView_; |
| 24 IBOutlet NSButton* addButton_; | 24 IBOutlet NSButton* addButton_; |
| 25 IBOutlet NSButton* removeButton_; | 25 IBOutlet NSButton* removeButton_; |
| 26 IBOutlet NSButton* removeAllButton_; | 26 IBOutlet NSButton* removeAllButton_; |
| 27 IBOutlet NSButton* doneButton_; | 27 IBOutlet NSButton* doneButton_; |
| 28 | 28 |
| 29 ContentSettingsType settingsType_; | 29 ContentSettingsType settingsType_; |
| 30 HostContentSettingsMap* settingsMap_; // weak | 30 HostContentSettingsMap* settingsMap_; // weak |
| 31 HostContentSettingsMap* otrSettingsMap_; // weak |
| 31 scoped_ptr<ContentExceptionsTableModel> model_; | 32 scoped_ptr<ContentExceptionsTableModel> model_; |
| 32 | 33 |
| 33 // Is set if "Ask" should be a valid option in the "action" popup. | 34 // Is set if "Ask" should be a valid option in the "action" popup. |
| 34 BOOL showAsk_; | 35 BOOL showAsk_; |
| 35 | 36 |
| 37 // Is set if adding and editing exceptions for the current OTR session should |
| 38 // be allowed. |
| 39 BOOL otrAllowed_; |
| 40 |
| 36 // Listens for changes to the content settings and reloads the data when they | 41 // Listens for changes to the content settings and reloads the data when they |
| 37 // change. See comment in -modelDidChange in the mm file for details. | 42 // change. See comment in -modelDidChange in the mm file for details. |
| 38 scoped_ptr<UpdatingContentSettingsObserver> tableObserver_; | 43 scoped_ptr<UpdatingContentSettingsObserver> tableObserver_; |
| 39 | 44 |
| 40 // If this is set to NO, notifications by |tableObserver_| are ignored. This | 45 // If this is set to NO, notifications by |tableObserver_| are ignored. This |
| 41 // is used to suppress updates at bad times. | 46 // is used to suppress updates at bad times. |
| 42 BOOL updatesEnabled_; | 47 BOOL updatesEnabled_; |
| 43 | 48 |
| 44 // This is non-NULL only while a new element is being added and its pattern | 49 // This is non-NULL only while a new element is being added and its pattern |
| 45 // is being edited. | 50 // is being edited. |
| 46 scoped_ptr<HostContentSettingsMap::PatternSettingPair> newException_; | 51 scoped_ptr<HostContentSettingsMap::PatternSettingPair> newException_; |
| 47 } | 52 } |
| 48 | 53 |
| 49 // Returns the content exceptions window controller for |settingsType|. | 54 // Returns the content exceptions window controller for |settingsType|. |
| 50 // Changes made by the user in the window are persisted in |settingsMap|. | 55 // Changes made by the user in the window are persisted in |settingsMap|. |
| 51 + (id)controllerForType:(ContentSettingsType)settingsType | 56 + (id)controllerForType:(ContentSettingsType)settingsType |
| 52 settingsMap:(HostContentSettingsMap*)settingsMap; | 57 settingsMap:(HostContentSettingsMap*)settingsMap |
| 58 otrSettingsMap:(HostContentSettingsMap*)otrSettingsMap; |
| 53 | 59 |
| 54 // Shows the exceptions dialog as a modal sheet attached to |window|. | 60 // Shows the exceptions dialog as a modal sheet attached to |window|. |
| 55 - (void)attachSheetTo:(NSWindow*)window; | 61 - (void)attachSheetTo:(NSWindow*)window; |
| 56 | 62 |
| 57 // Sets the minimum width of the sheet and resizes it if necessary. | 63 // Sets the minimum width of the sheet and resizes it if necessary. |
| 58 - (void)setMinWidth:(CGFloat)minWidth; | 64 - (void)setMinWidth:(CGFloat)minWidth; |
| 59 | 65 |
| 60 - (IBAction)addException:(id)sender; | 66 - (IBAction)addException:(id)sender; |
| 61 - (IBAction)removeException:(id)sender; | 67 - (IBAction)removeException:(id)sender; |
| 62 - (IBAction)removeAllExceptions:(id)sender; | 68 - (IBAction)removeAllExceptions:(id)sender; |
| 63 // Closes the sheet and ends the modal loop. | 69 // Closes the sheet and ends the modal loop. |
| 64 - (IBAction)closeSheet:(id)sender; | 70 - (IBAction)closeSheet:(id)sender; |
| 65 | 71 |
| 66 @end | 72 @end |
| 67 | 73 |
| 68 @interface ContentExceptionsWindowController(VisibleForTesting) | 74 @interface ContentExceptionsWindowController(VisibleForTesting) |
| 69 - (void)cancel:(id)sender; | 75 - (void)cancel:(id)sender; |
| 70 - (BOOL)editingNewException; | 76 - (BOOL)editingNewException; |
| 71 @end | 77 @end |
| OLD | NEW |