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; ...@@ -26,7 +26,14 @@ class WebsiteSettingsUIBridge;
// Display the identity status (e.g. verified, not verified). // Display the identity status (e.g. verified, not verified).
NSTextField* identityStatusField_; 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_; NSImageView* identityStatusIcon_;
NSTextField* identityStatusDescriptionField_; NSTextField* identityStatusDescriptionField_;
...@@ -40,8 +47,6 @@ class WebsiteSettingsUIBridge; ...@@ -40,8 +47,6 @@ class WebsiteSettingsUIBridge;
NSTextField* firstVisitHeaderField_; NSTextField* firstVisitHeaderField_;
NSTextField* firstVisitDescriptionField_; NSTextField* firstVisitDescriptionField_;
CGFloat permissionsTabHeight_;
// The UI translates user actions to specific events and forwards them to the // The UI translates user actions to specific events and forwards them to the
// |presenter_|. The |presenter_| handles these events and updates the UI. // |presenter_|. The |presenter_| handles these events and updates the UI.
scoped_ptr<WebsiteSettings> presenter_; scoped_ptr<WebsiteSettings> presenter_;
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#include "testing/gtest_mac.h" #include "testing/gtest_mac.h"
@interface WebsiteSettingsBubbleController (ExposedForTesting) @interface WebsiteSettingsBubbleController (ExposedForTesting)
- (NSView*)permissionsContentView; - (NSView*)permissionsView;
- (NSImageView*)identityStatusIcon; - (NSImageView*)identityStatusIcon;
- (NSTextField*)identityStatusDescriptionField; - (NSTextField*)identityStatusDescriptionField;
- (NSImageView*)connectionStatusIcon; - (NSImageView*)connectionStatusIcon;
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
@end @end
@implementation WebsiteSettingsBubbleController (ExposedForTesting) @implementation WebsiteSettingsBubbleController (ExposedForTesting)
- (NSView*)permissionsContentView { - (NSView*)permissionsView {
return permissionsContentView_; return permissionsView_;
} }
- (NSImageView*)identityStatusIcon { - (NSImageView*)identityStatusIcon {
...@@ -205,9 +205,10 @@ TEST_F(WebsiteSettingsBubbleControllerTest, SetPermissionInfo) { ...@@ -205,9 +205,10 @@ TEST_F(WebsiteSettingsBubbleControllerTest, SetPermissionInfo) {
} }
bridge_->SetPermissionInfo(list); bridge_->SetPermissionInfo(list);
// There should be two subviews per permission: a label and a select box. // There should be three subviews per permission (an icon, a label and a
NSArray* subviews = [[controller_ permissionsContentView] subviews]; // select box), plus a text label for the Permission section.
EXPECT_EQ(arraysize(kTestPermissionTypes) * 2, [subviews count]); NSArray* subviews = [[controller_ permissionsView] subviews];
EXPECT_EQ(arraysize(kTestPermissionTypes) * 3 + 1, [subviews count]);
// Ensure that there is a distinct label for each permission. // Ensure that there is a distinct label for each permission.
NSMutableSet* labels = [NSMutableSet set]; NSMutableSet* labels = [NSMutableSet set];
...@@ -215,7 +216,8 @@ TEST_F(WebsiteSettingsBubbleControllerTest, SetPermissionInfo) { ...@@ -215,7 +216,8 @@ TEST_F(WebsiteSettingsBubbleControllerTest, SetPermissionInfo) {
if ([view isKindOfClass:[NSTextField class]]) if ([view isKindOfClass:[NSTextField class]])
[labels addObject:[static_cast<NSTextField*>(view) stringValue]]; [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 // Find the first permission pop-up button
NSPopUpButton* button = nil; 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