summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/cookies_window_controller.mm
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 21:04:28 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-09 21:04:28 +0000
commit9e4683cd3808c3ad9cb1233ecc2e647e9772c0f6 (patch)
treebd831b15f269803e98540f78b0fe4ab9c90ffa0e /chrome/browser/cocoa/cookies_window_controller.mm
parent2559e45a158b52215534b09c4e0be13f7e3b275a (diff)
downloadchromium_src-9e4683cd3808c3ad9cb1233ecc2e647e9772c0f6.zip
chromium_src-9e4683cd3808c3ad9cb1233ecc2e647e9772c0f6.tar.gz
chromium_src-9e4683cd3808c3ad9cb1233ecc2e647e9772c0f6.tar.bz2
[Mac] Add local storage nodes to the cookie manager
* Add local storage getters to CookieTreeNode * XIB: Embed cookie info labels into an NSView (inside the NSBox) and add another for info NSView for local storage. * Roll GTM r280:293 BUG=33068 TEST=Chromium-->Preferences-->Under the Hood-->Show cookies... Find and click on a local storage node. Info should be displayed. Review URL: http://codereview.chromium.org/599003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38504 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/cookies_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/cookies_window_controller.mm19
1 files changed, 18 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/cookies_window_controller.mm b/chrome/browser/cocoa/cookies_window_controller.mm
index 4266577..b760c41 100644
--- a/chrome/browser/cocoa/cookies_window_controller.mm
+++ b/chrome/browser/cocoa/cookies_window_controller.mm
@@ -320,7 +320,8 @@ bool CookiesTreeModelObserverBridge::HasCocoaModel() {
- (void)outlineViewSelectionDidChange:(NSNotification*)notif {
// Multi-selection should be disabled in the UI, but for sanity, double-check
// that they can't do it here.
- NSUInteger count = [[treeController_ selectedObjects] count];
+ NSArray* selectedObjects = [treeController_ selectedObjects];
+ NSUInteger count = [selectedObjects count];
if (count != 1U) {
DCHECK_LT(count, 1U) << "User was able to select more than 1 cookie node!";
[self setRemoveButtonEnabled:NO];
@@ -342,6 +343,14 @@ bool CookiesTreeModelObserverBridge::HasCocoaModel() {
}
[self setRemoveButtonEnabled:YES];
+ CocoaCookieTreeNodeType nodeType = [[selectedObjects lastObject] nodeType];
+ if (nodeType == kCocoaCookieTreeNodeTypeLocalStorage) {
+ [cookieInfo_ setHidden:YES];
+ [localStorageInfo_ setHidden:NO];
+ } else {
+ [cookieInfo_ setHidden:NO];
+ [localStorageInfo_ setHidden:YES];
+ }
}
#pragma mark Unit Testing
@@ -354,6 +363,14 @@ bool CookiesTreeModelObserverBridge::HasCocoaModel() {
return icons_.get();
}
+- (NSView*)cookieInfoView {
+ return cookieInfo_;
+}
+
+- (NSView*)localStorageInfoView {
+ return localStorageInfo_;
+}
+
// Re-initializes the |treeModel_|, creates a new observer for it, and re-
// builds the |cocoaTreeModel_|. We use this to initialize the controller and
// to rebuild after the user clears browsing data. Because the models get