summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/cookies_window_controller.mm
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-24 11:45:17 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-24 11:45:17 +0000
commit51f70bd8def42cd3adfcf6fd20940a8f0bcd3cb3 (patch)
treea29ceed1c11066cda3098a30083fca7a1007ad21 /chrome/browser/cocoa/cookies_window_controller.mm
parentfa80b6bd888d00b49ed87a3f5722e064141ffb46 (diff)
downloadchromium_src-51f70bd8def42cd3adfcf6fd20940a8f0bcd3cb3.zip
chromium_src-51f70bd8def42cd3adfcf6fd20940a8f0bcd3cb3.tar.gz
chromium_src-51f70bd8def42cd3adfcf6fd20940a8f0bcd3cb3.tar.bz2
[Mac] Implement HTML5 database items in "Cookies and Other Data" dialog.
Code changes to support a new variant of CocoaCookieTreeNode that displays the information about web databases. Changes to Cookies.xib: Added a new NSView "Database" in the existing information summary view for items selected in the cookie tree. This Database view provides the details for selected items that are web databases, and is in the same implement + layout style as the existing "Cookie" and "Local Storage" views. Added a key "databaseDescription" to the CocoaCookieTreeNode to support the display of the new node type. TEST=manual testing in the "Cookies and Other Data" dialog BUG=http://crbug.com/35191 Patch from Dan Clifford <danno@google.com>. Review URL: http://codereview.chromium.org/596058 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39882 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/cookies_window_controller.mm')
-rw-r--r--chrome/browser/cocoa/cookies_window_controller.mm26
1 files changed, 19 insertions, 7 deletions
diff --git a/chrome/browser/cocoa/cookies_window_controller.mm b/chrome/browser/cocoa/cookies_window_controller.mm
index cec7f71..70fddc7 100644
--- a/chrome/browser/cocoa/cookies_window_controller.mm
+++ b/chrome/browser/cocoa/cookies_window_controller.mm
@@ -327,6 +327,12 @@ bool CookiesTreeModelObserverBridge::HasCocoaModel() {
if (count != 1U) {
DCHECK_LT(count, 1U) << "User was able to select more than 1 cookie node!";
[self setRemoveButtonEnabled:NO];
+
+ // Make sure that the cookie info pane is shown when there is no selection.
+ // That's what windows does.
+ [cookieInfo_ setHidden:NO];
+ [localStorageInfo_ setHidden:YES];
+ [databaseInfo_ setHidden:YES];
return;
}
@@ -346,13 +352,15 @@ 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];
- }
+ bool hideCookieInfoView = nodeType != kCocoaCookieTreeNodeTypeCookie &&
+ nodeType != kCocoaCookieTreeNodeTypeFolder;
+ bool hideLocaStorageInfoView =
+ nodeType != kCocoaCookieTreeNodeTypeLocalStorage;
+ bool hideDatabaseInfoView =
+ nodeType != kCocoaCookieTreeNodeTypeDatabaseStorage;
+ [cookieInfo_ setHidden:hideCookieInfoView];
+ [localStorageInfo_ setHidden:hideLocaStorageInfoView];
+ [databaseInfo_ setHidden:hideDatabaseInfoView];
}
#pragma mark Unit Testing
@@ -373,6 +381,10 @@ bool CookiesTreeModelObserverBridge::HasCocoaModel() {
return localStorageInfo_;
}
+- (NSView*)databaseInfoView {
+ return databaseInfo_;
+}
+
// 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