Commit ce596d38 authored by dubroy@chromium.org's avatar dubroy@chromium.org

[Mac] Website settings: Add cookie info & permission icons, plus other visual fixes.

Changes to the UI to bring it closer to the mocks:
- Add cookies section to Permissions tab, and add "Cookies" and "Permissions" headers.
- Change identity status text to green when the site identity is verified.
- Add permission icons to the Permissions tab.

BUG=135407

Review URL: https://chromiumcodereview.appspot.com/10831280

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151448 0039d316-1c4b-4281-b951-d872f2087c98
parent f8112e58
......@@ -26,7 +26,14 @@ class WebsiteSettingsUIBridge;
// Display the identity status (e.g. verified, not verified).
NSTextField* identityStatusField_;
NSView* permissionsContentView_;
// The main content view for the Permissions tab.
NSView* permissionsTabContentView_;
// Container for cookies info on the Permissions tab.
NSView* cookiesView_;
// Container for permission info on the Permissions tab.
NSView* permissionsView_;
NSImageView* identityStatusIcon_;
NSTextField* identityStatusDescriptionField_;
......@@ -40,8 +47,6 @@ class WebsiteSettingsUIBridge;
NSTextField* firstVisitHeaderField_;
NSTextField* firstVisitDescriptionField_;
CGFloat permissionsTabHeight_;
// The UI translates user actions to specific events and forwards them to the
// |presenter_|. The |presenter_| handles these events and updates the UI.
scoped_ptr<WebsiteSettings> presenter_;
......
......@@ -9,7 +9,7 @@
#include "testing/gtest_mac.h"
@interface WebsiteSettingsBubbleController (ExposedForTesting)
- (NSView*)permissionsContentView;
- (NSView*)permissionsView;
- (NSImageView*)identityStatusIcon;
- (NSTextField*)identityStatusDescriptionField;
- (NSImageView*)connectionStatusIcon;
......@@ -18,8 +18,8 @@
@end
@implementation WebsiteSettingsBubbleController (ExposedForTesting)
- (NSView*)permissionsContentView {
return permissionsContentView_;
- (NSView*)permissionsView {
return permissionsView_;
}
- (NSImageView*)identityStatusIcon {
......@@ -205,9 +205,10 @@ TEST_F(WebsiteSettingsBubbleControllerTest, SetPermissionInfo) {
}
bridge_->SetPermissionInfo(list);
// There should be two subviews per permission: a label and a select box.
NSArray* subviews = [[controller_ permissionsContentView] subviews];
EXPECT_EQ(arraysize(kTestPermissionTypes) * 2, [subviews count]);
// There should be three subviews per permission (an icon, a label and a
// select box), plus a text label for the Permission section.
NSArray* subviews = [[controller_ permissionsView] subviews];
EXPECT_EQ(arraysize(kTestPermissionTypes) * 3 + 1, [subviews count]);
// Ensure that there is a distinct label for each permission.
NSMutableSet* labels = [NSMutableSet set];
......@@ -215,7 +216,8 @@ TEST_F(WebsiteSettingsBubbleControllerTest, SetPermissionInfo) {
if ([view isKindOfClass:[NSTextField class]])
[labels addObject:[static_cast<NSTextField*>(view) stringValue]];
}
EXPECT_EQ(arraysize(kTestPermissionTypes), [labels count]);
// The section header ("Permissions") will also be found, hence the +1.
EXPECT_EQ(arraysize(kTestPermissionTypes) + 1, [labels count]);
// Find the first permission pop-up button
NSPopUpButton* button = nil;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment