| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "base/mac/scoped_nsobject.h" | 7 #include "base/mac/scoped_nsobject.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "chrome/browser/browsing_data/cookies_tree_model.h" | 9 #include "chrome/browser/browsing_data/cookies_tree_model.h" |
| 10 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" | 10 #include "chrome/browser/ui/cocoa/constrained_window/constrained_window_mac.h" |
| 11 #import "chrome/browser/ui/cocoa/content_settings/cookie_tree_node.h" | 11 #import "chrome/browser/ui/cocoa/content_settings/cookie_tree_node.h" |
| 12 #import "chrome/browser/ui/cocoa/content_settings/cookies_tree_controller_bridge
.h" |
| 12 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
| 14 | 15 |
| 15 @class CollectedCookiesWindowController; | 16 @class CollectedCookiesWindowController; |
| 16 @class CookieDetailsViewController; | 17 @class CookieDetailsViewController; |
| 17 @class VerticalGradientView; | 18 @class VerticalGradientView; |
| 18 | 19 |
| 19 namespace content { | 20 namespace content { |
| 20 class WebContents; | 21 class WebContents; |
| 21 } | 22 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 NSWindowDelegate> { | 65 NSWindowDelegate> { |
| 65 @private | 66 @private |
| 66 // Platform-independent model. | 67 // Platform-independent model. |
| 67 scoped_ptr<CookiesTreeModel> allowedTreeModel_; | 68 scoped_ptr<CookiesTreeModel> allowedTreeModel_; |
| 68 scoped_ptr<CookiesTreeModel> blockedTreeModel_; | 69 scoped_ptr<CookiesTreeModel> blockedTreeModel_; |
| 69 | 70 |
| 70 // Cached array of icons. | 71 // Cached array of icons. |
| 71 base::scoped_nsobject<NSMutableArray> icons_; | 72 base::scoped_nsobject<NSMutableArray> icons_; |
| 72 | 73 |
| 73 // Our Cocoa copy of the model. | 74 // Our Cocoa copy of the model. |
| 74 base::scoped_nsobject<CocoaCookieTreeNode> cocoaAllowedTreeModel_; | 75 scoped_ptr<CookiesTreeControllerBridge> allowedControllerBridge_; |
| 75 base::scoped_nsobject<CocoaCookieTreeNode> cocoaBlockedTreeModel_; | 76 scoped_ptr<CookiesTreeControllerBridge> blockedControllerBridge_; |
| 76 | 77 |
| 77 BOOL allowedCookiesButtonsEnabled_; | 78 BOOL allowedCookiesButtonsEnabled_; |
| 78 BOOL blockedCookiesButtonsEnabled_; | 79 BOOL blockedCookiesButtonsEnabled_; |
| 80 BOOL deleteCookiesButtonEnabled_; // Only in the allowed pane. |
| 79 | 81 |
| 80 IBOutlet NSTreeController* allowedTreeController_; | 82 IBOutlet NSTreeController* allowedTreeController_; |
| 81 IBOutlet NSTreeController* blockedTreeController_; | 83 IBOutlet NSTreeController* blockedTreeController_; |
| 82 IBOutlet NSOutlineView* allowedOutlineView_; | 84 IBOutlet NSOutlineView* allowedOutlineView_; |
| 83 IBOutlet NSOutlineView* blockedOutlineView_; | 85 IBOutlet NSOutlineView* blockedOutlineView_; |
| 84 IBOutlet VerticalGradientView* infoBar_; | 86 IBOutlet VerticalGradientView* infoBar_; |
| 85 IBOutlet NSImageView* infoBarIcon_; | 87 IBOutlet NSImageView* infoBarIcon_; |
| 86 IBOutlet NSTextField* infoBarText_; | 88 IBOutlet NSTextField* infoBarText_; |
| 87 IBOutlet NSTabView* tabView_; | 89 IBOutlet NSTabView* tabView_; |
| 88 IBOutlet NSScrollView* blockedScrollView_; | 90 IBOutlet NSScrollView* blockedScrollView_; |
| (...skipping 20 matching lines...) Expand all Loading... |
| 109 @property(readonly, nonatomic) IBOutlet VerticalGradientView* infoBar; | 111 @property(readonly, nonatomic) IBOutlet VerticalGradientView* infoBar; |
| 110 @property(readonly, nonatomic) IBOutlet NSImageView* infoBarIcon; | 112 @property(readonly, nonatomic) IBOutlet NSImageView* infoBarIcon; |
| 111 @property(readonly, nonatomic) IBOutlet NSTextField* infoBarText; | 113 @property(readonly, nonatomic) IBOutlet NSTextField* infoBarText; |
| 112 @property(readonly, nonatomic) IBOutlet NSTabView* tabView; | 114 @property(readonly, nonatomic) IBOutlet NSTabView* tabView; |
| 113 @property(readonly, nonatomic) IBOutlet NSScrollView* blockedScrollView; | 115 @property(readonly, nonatomic) IBOutlet NSScrollView* blockedScrollView; |
| 114 @property(readonly, nonatomic) IBOutlet NSTextField* blockedCookiesText; | 116 @property(readonly, nonatomic) IBOutlet NSTextField* blockedCookiesText; |
| 115 @property(readonly, nonatomic) IBOutlet NSView* cookieDetailsViewPlaceholder; | 117 @property(readonly, nonatomic) IBOutlet NSView* cookieDetailsViewPlaceholder; |
| 116 | 118 |
| 117 @property(assign, nonatomic) BOOL allowedCookiesButtonsEnabled; | 119 @property(assign, nonatomic) BOOL allowedCookiesButtonsEnabled; |
| 118 @property(assign, nonatomic) BOOL blockedCookiesButtonsEnabled; | 120 @property(assign, nonatomic) BOOL blockedCookiesButtonsEnabled; |
| 121 @property(assign, nonatomic) BOOL deleteCookiesButtonEnabled; |
| 119 | 122 |
| 120 // Designated initializer. The WebContents cannot be NULL. | 123 // Designated initializer. The WebContents cannot be NULL. |
| 121 - (id)initWithWebContents:(content::WebContents*)webContents | 124 - (id)initWithWebContents:(content::WebContents*)webContents |
| 122 collectedCookiesMac:(CollectedCookiesMac*)collectedCookiesMac; | 125 collectedCookiesMac:(CollectedCookiesMac*)collectedCookiesMac; |
| 123 | 126 |
| 124 // Closes the sheet and ends the modal loop. This will also clean up the memory. | 127 // Closes the sheet and ends the modal loop. This will also clean up the memory. |
| 125 - (IBAction)closeSheet:(id)sender; | 128 - (IBAction)closeSheet:(id)sender; |
| 126 | 129 |
| 127 - (IBAction)allowOrigin:(id)sender; | 130 - (IBAction)allowOrigin:(id)sender; |
| 128 - (IBAction)allowForSessionFromOrigin:(id)sender; | 131 - (IBAction)allowForSessionFromOrigin:(id)sender; |
| 129 - (IBAction)blockOrigin:(id)sender; | 132 - (IBAction)blockOrigin:(id)sender; |
| 130 | 133 |
| 134 // Allows the deletion of set cookies (only visible in the Allowed pane). |
| 135 - (IBAction)deleteSelected:(id)sender; |
| 136 |
| 131 // Returns the |cocoaAllowedTreeModel_| and |cocoaBlockedTreeModel_|. | 137 // Returns the |cocoaAllowedTreeModel_| and |cocoaBlockedTreeModel_|. |
| 132 - (CocoaCookieTreeNode*)cocoaAllowedTreeModel; | 138 - (CocoaCookieTreeNode*)cocoaAllowedTreeModel; |
| 133 - (CocoaCookieTreeNode*)cocoaBlockedTreeModel; | 139 - (CocoaCookieTreeNode*)cocoaBlockedTreeModel; |
| 134 - (void)setCocoaAllowedTreeModel:(CocoaCookieTreeNode*)model; | |
| 135 - (void)setCocoaBlockedTreeModel:(CocoaCookieTreeNode*)model; | |
| 136 | 140 |
| 137 // Returns the |allowedTreeModel_| and |blockedTreeModel_|. | 141 // Returns the |allowedTreeModel_| and |blockedTreeModel_|. |
| 138 - (CookiesTreeModel*)allowedTreeModel; | 142 - (CookiesTreeModel*)allowedTreeModel; |
| 139 - (CookiesTreeModel*)blockedTreeModel; | 143 - (CookiesTreeModel*)blockedTreeModel; |
| 140 | 144 |
| 141 - (void)loadTreeModelFromWebContents; | 145 - (void)loadTreeModelFromWebContents; |
| 142 @end | 146 @end |
| OLD | NEW |