diff options
author | palmer <palmer@chromium.org> | 2015-02-10 16:42:19 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-11 00:43:17 +0000 |
commit | 0da10b3d82306dca4940214afbdc8f3c35a00b08 (patch) | |
tree | e4ab7f9fd9ff5440cdbe7fd2537beb52b4016c08 | |
parent | df4e3ad2341ada95223f6917b7296a09251d5dd2 (diff) | |
download | chromium_src-0da10b3d82306dca4940214afbdc8f3c35a00b08.zip chromium_src-0da10b3d82306dca4940214afbdc8f3c35a00b08.tar.gz chromium_src-0da10b3d82306dca4940214afbdc8f3c35a00b08.tar.bz2 |
Limit the display of permissions in the Origin Info Bubble, so that only those settings that are not the defaults are shown. Re-order the permissions so that the most important permissions are shown first. Show a Site Settings link/button to allow users to see the non-default settings.
BUG=444244
Review URL: https://codereview.chromium.org/810893003
Cr-Commit-Position: refs/heads/master@{#315691}
12 files changed, 174 insertions, 89 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 6dd0644..a164890 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -9612,6 +9612,9 @@ I don't think this site should be blocked! <message name="IDS_PAGE_INFO_HELP_CENTER_LINK" desc="This is the text of the link pointing to the Help Center. This appears at the bottom of the SSL dialog and 'this' refers to the sections within the bubble."> What do these mean? </message> + <message name="IDS_PAGE_INFO_SITE_SETTINGS_LINK" desc="This is the text of the link pointing to Chrome's Site Settings page. This appears at the bottom of the Permissions pane of the Page Information Window."> + Site settings + </message> <message name="IDS_PAGE_INFO_SECURITY_TAB_SECURE_IDENTITY_NO_CT" desc="The text of the identity section when the page is secure and no Certificate Transparency information is present."> The identity of this website has been verified by <ph name="ISSUER">$1<ex>VeriSign</ex></ph> but does not have public audit records. diff --git a/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.h b/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.h index 9ede7f2..620ea7f 100644 --- a/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.h +++ b/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.h @@ -17,6 +17,9 @@ class WebContents; // This NSWindowController subclass manages the InfoBubbleWindow and view that // are displayed when the user clicks the favicon or security lock icon. +// +// TODO(palmer, sashab): Normalize all WebsiteSettings*, SiteSettings*, +// PageInfo*, et c. to OriginInfo*. @interface WebsiteSettingsBubbleController : BaseBubbleController { @private content::WebContents* webContents_; @@ -43,14 +46,17 @@ class WebContents; // The link button for showing cookies and site data info. NSButton* cookiesButton_; + // The link button for showing site settings. + NSButton* siteSettingsButton_; + // The link button for showing certificate information. NSButton* certificateInfoButton_; // The link button for revoking certificate decisions. NSButton* resetDecisionsButton_; - // The ID of the server certificate from the identity info. - // This should always be non-zero on a secure connection, and 0 otherwise. + // The ID of the server certificate from the identity info. This should + // always be non-zero on a secure connection, and 0 otherwise. int certificateId_; // Container for permission info on the Permissions tab. @@ -69,7 +75,7 @@ class WebContents; NSTextField* firstVisitDescriptionField_; NSView* separatorAfterFirstVisit_; - // The link button for launch the help center article explaining the + // The link button to launch the Help Center article explaining the // connection info. NSButton* helpButton_; @@ -104,10 +110,10 @@ class WebsiteSettingsUIBridge : public WebsiteSettingsUI { ~WebsiteSettingsUIBridge() override; // Creates a |WebsiteSettingsBubbleController| and displays the UI. |parent| - // contains the currently active window, |profile| contains the currently - // active profile and |ssl| contains the |SSLStatus| of the connection to the - // website in the currently active tab that is wrapped by the - // |web_contents|. + // is the currently active window. |profile| points to the currently active + // profile. |web_contents| points to the WebContents that wraps the currently + // active tab. |url| is the GURL of the currently active tab. |ssl| is the + // |SSLStatus| of the connection to the website in the currently active tab. static void Show(gfx::NativeWindow parent, Profile* profile, content::WebContents* web_contents, diff --git a/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm index e028136..bb43015 100644 --- a/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm +++ b/chrome/browser/ui/cocoa/website_settings/website_settings_bubble_controller.mm @@ -70,8 +70,8 @@ const CGFloat kInternalPageImageSize = 26; // Square size of the permission images. const CGFloat kPermissionImageSize = 19; -// Vertical adjustment for the permission images. -// They have an extra pixel of padding on the bottom edge. +// Vertical adjustment for the permission images. They have an extra pixel of +// padding on the bottom edge. const CGFloat kPermissionImageYAdjust = 1; // Spacing between a permission image and the text. @@ -507,8 +507,8 @@ NSColor* IdentityVerifiedTextColor() { [contentView addSubview:cookiesView_]; [contentView addSubview:permissionsView_]; - // Create the link button to view cookies and site data. - // Its position will be set in performLayout. + // Create the link button to view cookies and site data. Its position will be + // set in performLayout. NSString* cookieButtonText = l10n_util::GetNSString( IDS_WEBSITE_SETTINGS_SHOW_SITE_DATA); cookiesButton_ = [self addLinkButtonWithText:cookieButtonText @@ -516,17 +516,38 @@ NSColor* IdentityVerifiedTextColor() { [cookiesButton_ setTarget:self]; [cookiesButton_ setAction:@selector(showCookiesAndSiteData:)]; + // Create the link button to view site settings. Its position will be set in + // performLayout. + NSString* siteSettingsButtonText = + l10n_util::GetNSString(IDS_PAGE_INFO_SITE_SETTINGS_LINK); + siteSettingsButton_ = + [self addLinkButtonWithText:siteSettingsButtonText toView:contentView]; + [siteSettingsButton_ setTarget:self]; + [siteSettingsButton_ setAction:@selector(showSiteSettingsData:)]; + return contentView.get(); } // Handler for the link button below the list of cookies. - (void)showCookiesAndSiteData:(id)sender { DCHECK(webContents_); + DCHECK(presenter_); presenter_->RecordWebsiteSettingsAction( WebsiteSettings::WEBSITE_SETTINGS_COOKIES_DIALOG_OPENED); TabDialogs::FromWebContents(webContents_)->ShowCollectedCookies(); } +// Handler for the site settings button below the list of permissions. +- (void)showSiteSettingsData:(id)sender { + DCHECK(webContents_); + DCHECK(presenter_); + presenter_->RecordWebsiteSettingsAction( + WebsiteSettings::WEBSITE_SETTINGS_SITE_SETTINGS_OPENED); + webContents_->OpenURL(content::OpenURLParams( + GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(), + NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false)); +} + // Handler for the link button to show certificate information. - (void)showCertificateInfo:(id)sender { DCHECK(certificateId_); @@ -666,14 +687,15 @@ NSColor* IdentityVerifiedTextColor() { yPos = [self setYPositionOfView:cookiesView_ to:kFramePadding]; // Put the link button for cookies and site data just below the cookie info. - NSRect cookiesButtonFrame = [cookiesButton_ frame]; - cookiesButtonFrame.origin.y = yPos; - cookiesButtonFrame.origin.x = kFramePadding; - [cookiesButton_ setFrame:cookiesButtonFrame]; + [cookiesButton_ setFrameOrigin:NSMakePoint(kFramePadding, yPos)]; // Put the permission info just below the link button. - [self setYPositionOfView:permissionsView_ - to:NSMaxY(cookiesButtonFrame) + kFramePadding]; + yPos = + [self setYPositionOfView:permissionsView_ + to:NSMaxY([cookiesButton_ frame]) + kFramePadding]; + + // Put the link button for site settings just below the permissions. + [siteSettingsButton_ setFrameOrigin:NSMakePoint(kFramePadding, yPos)]; // Lay out the Connection tab. @@ -732,8 +754,8 @@ NSColor* IdentityVerifiedTextColor() { NSRect tabViewFrame = [tabView_ frame]; tabViewFrame.origin.y = yPos; - tabViewFrame.size.height = - std::max(connectionTabHeight, NSMaxY([permissionsView_ frame])); + tabViewFrame.size.height = std::max( + connectionTabHeight, NSMaxY([siteSettingsButton_ frame]) + kFramePadding); tabViewFrame.size.width = contentWidth; [tabView_ setFrame:tabViewFrame]; @@ -1151,27 +1173,30 @@ NSColor* IdentityVerifiedTextColor() { [permissionsView_ setSubviews:[NSArray array]]; NSPoint controlOrigin = NSMakePoint(kFramePadding, 0); - base::string16 sectionTitle = l10n_util::GetStringUTF16( - IDS_WEBSITE_SETTINGS_TITLE_SITE_PERMISSIONS); - NSTextField* header = [self addText:sectionTitle - withSize:[NSFont smallSystemFontSize] - bold:YES - toView:permissionsView_ - atPoint:controlOrigin]; - [self sizeTextFieldHeightToFit:header]; - controlOrigin.y += NSHeight([header frame]) + kPermissionsHeadlineSpacing; - - for (PermissionInfoList::const_iterator permission = - permissionInfoList.begin(); - permission != permissionInfoList.end(); - ++permission) { - controlOrigin.y += kPermissionsTabSpacing; - NSPoint rowBottomRight = [self addPermission:*permission - toView:permissionsView_ - atPoint:controlOrigin]; - controlOrigin.y = rowBottomRight.y; + if (permissionInfoList.size() > 0) { + base::string16 sectionTitle = l10n_util::GetStringUTF16( + IDS_WEBSITE_SETTINGS_TITLE_SITE_PERMISSIONS); + NSTextField* header = [self addText:sectionTitle + withSize:[NSFont smallSystemFontSize] + bold:YES + toView:permissionsView_ + atPoint:controlOrigin]; + [self sizeTextFieldHeightToFit:header]; + controlOrigin.y += NSHeight([header frame]) + kPermissionsHeadlineSpacing; + + for (PermissionInfoList::const_iterator permission = + permissionInfoList.begin(); + permission != permissionInfoList.end(); + ++permission) { + controlOrigin.y += kPermissionsTabSpacing; + NSPoint rowBottomRight = [self addPermission:*permission + toView:permissionsView_ + atPoint:controlOrigin]; + controlOrigin.y = rowBottomRight.y; + } + controlOrigin.y += kFramePadding; } - controlOrigin.y += kFramePadding; + [permissionsView_ setFrameSize: NSMakeSize(NSWidth([permissionsView_ frame]), controlOrigin.y)]; [self performLayout]; diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc index 51ffb802..b992496 100644 --- a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc +++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc @@ -303,6 +303,7 @@ WebsiteSettingsPopupView::WebsiteSettingsPopupView( browser_(browser), header_(nullptr), tabbed_pane_(nullptr), + permissions_tab_(nullptr), site_data_content_(nullptr), cookie_dialog_link_(nullptr), permissions_content_(nullptr), @@ -339,15 +340,16 @@ WebsiteSettingsPopupView::WebsiteSettingsPopupView( tabbed_pane_ = new views::TabbedPane(); layout->StartRow(1, content_column); layout->AddView(tabbed_pane_); - // Tabs must be added after the tabbed_pane_ was added to the views - // hierachy. Adding the |tabbed_pane_| to the views hierachy triggers the - // initialization of the native tab UI element. If the native tab UI - // element is not initalized adding a tab will result in a NULL pointer - // exception. + + // Tabs must be added after the tabbed_pane_ was added to the views hierarchy. + // Adding the |tabbed_pane_| to the views hierarchy triggers the + // initialization of the native tab UI element. If the native tab UI element + // is not initalized, adding a tab will result in a NULL pointer exception. + permissions_tab_ = CreatePermissionsTab(); tabbed_pane_->AddTabAtIndex( TAB_ID_PERMISSIONS, l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_TAB_LABEL_PERMISSIONS), - CreatePermissionsTab()); + permissions_tab_); connection_tab_ = CreateConnectionTab(); tabbed_pane_->AddTabAtIndex( TAB_ID_CONNECTION, @@ -414,6 +416,18 @@ void WebsiteSettingsPopupView::LinkClicked(views::Link* source, false)); presenter_->RecordWebsiteSettingsAction( WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_HELP_OPENED); + } else if (source == site_settings_link_) { + // TODO(palmer): This opens the general Content Settings pane, which is OK + // for now. But on Android, it opens a page specific to a given origin that + // shows all of the settings for that origin. If/when that's available on + // desktop we should link to that here, too. + browser_->OpenURL(content::OpenURLParams( + GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(), + NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false)); + presenter_->RecordWebsiteSettingsAction( + WebsiteSettings::WEBSITE_SETTINGS_SITE_SETTINGS_OPENED); + } else { + NOTREACHED(); } } @@ -515,14 +529,21 @@ void WebsiteSettingsPopupView::SetCookieInfo( void WebsiteSettingsPopupView::SetPermissionInfo( const PermissionInfoList& permission_info_list) { - permissions_content_->RemoveAllChildViews(true); - - views::GridLayout* layout = - new views::GridLayout(permissions_content_); + permissions_content_ = new views::View(); + views::GridLayout* layout = new views::GridLayout(permissions_content_); permissions_content_->SetLayoutManager(layout); + + base::string16 headline = + permission_info_list.empty() + ? base::string16() + : l10n_util::GetStringUTF16( + IDS_WEBSITE_SETTINGS_TITLE_SITE_PERMISSIONS); + views::View* permissions_section = + CreateSection(headline, permissions_content_, nullptr); + permissions_tab_->AddChildView(permissions_section); + const int content_column = 0; - views::ColumnSet* column_set = - layout->AddColumnSet(content_column); + views::ColumnSet* column_set = layout->AddColumnSet(content_column); column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL, 1, @@ -546,6 +567,20 @@ void WebsiteSettingsPopupView::SetPermissionInfo( layout->AddPaddingRow(1, kPermissionsSectionRowSpacing); } + layout->Layout(permissions_content_); + + // Add site settings link. + site_settings_link_ = new views::Link( + l10n_util::GetStringUTF16(IDS_PAGE_INFO_SITE_SETTINGS_LINK)); + site_settings_link_->set_listener(this); + views::View* link_section = new views::View(); + const int kLinkMarginTop = 4; + link_section->SetLayoutManager( + new views::BoxLayout(views::BoxLayout::kHorizontal, + kConnectionSectionPaddingLeft, kLinkMarginTop, 0)); + link_section->AddChildView(site_settings_link_); + permissions_tab_->AddChildView(link_section); + SizeToContents(); } @@ -651,6 +686,7 @@ views::View* WebsiteSettingsPopupView::CreatePermissionsTab() { views::View* pane = new views::View(); pane->SetLayoutManager( new views::BoxLayout(views::BoxLayout::kVertical, 0, 0, 1)); + // Add cookies and site data section. cookie_dialog_link_ = new views::Link( l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_SHOW_SITE_DATA)); @@ -662,14 +698,7 @@ views::View* WebsiteSettingsPopupView::CreatePermissionsTab() { site_data_content_, cookie_dialog_link_); pane->AddChildView(site_data_section); - // Add permissions section. - permissions_content_ = new views::View(); - views::View* permissions_section = - CreateSection(l10n_util::GetStringUTF16( - IDS_WEBSITE_SETTINGS_TITLE_SITE_PERMISSIONS), - permissions_content_, - nullptr); - pane->AddChildView(permissions_section); + return pane; } @@ -725,13 +754,15 @@ views::View* WebsiteSettingsPopupView::CreateSection( 0, 0); - layout->AddPaddingRow(1, kPermissionsSectionPaddingTop); - layout->StartRow(1, content_column); - ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); - views::Label* headline = new views::Label( - headline_text, rb.GetFontList(ui::ResourceBundle::BoldFont)); - layout->AddView(headline, 1, 1, views::GridLayout::LEADING, - views::GridLayout::CENTER); + if (headline_text.length() > 0) { + layout->AddPaddingRow(1, kPermissionsSectionPaddingTop); + layout->StartRow(1, content_column); + ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); + views::Label* headline = new views::Label( + headline_text, rb.GetFontList(ui::ResourceBundle::BoldFont)); + layout->AddView(headline, 1, 1, views::GridLayout::LEADING, + views::GridLayout::CENTER); + } layout->AddPaddingRow(1, kPermissionsSectionHeadlineMarginBottom); layout->StartRow(1, content_column); diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view.h b/chrome/browser/ui/views/website_settings/website_settings_popup_view.h index 7e2a07a..ce647b4 100644 --- a/chrome/browser/ui/views/website_settings/website_settings_popup_view.h +++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view.h @@ -109,11 +109,11 @@ class WebsiteSettingsPopupView views::Link* link) WARN_UNUSED_RESULT; // Resets the content of a section. All children of the |section_container| - // are cleared and destroyed first. Then the |icon|, |headline|, |text| and - // |link| are layout out properly. If the |headline| is an empty string then - // no headline will be displayed. The ownership of the passed |link| is - // transfered to the ResetConnectionSection method and the |link| is added to - // the views hierarchy. If the |link| is NULL then no link is be displayed. + // are cleared and destroyed first. Then the |icon|, |headline|, |text|, + // |link|, and |secondary_link| are laid out properly. If the |headline| is an + // empty string then no headline will be displayed. Ownership of |link| and + // |secondary_link| is transfered to the ResetConnectionSection method and the + // links are added to the views hierarchy. NULL links are not displayed. void ResetConnectionSection(views::View* section_container, const gfx::Image& icon, const base::string16& headline, @@ -129,7 +129,7 @@ class WebsiteSettingsPopupView // The Browser is used to load the help center page. Browser* browser_; - // The presenter that controlls the Website Settings UI. + // The presenter that controls the Website Settings UI. scoped_ptr<WebsiteSettings> presenter_; PopupHeaderView* header_; // Owned by views hierarchy. @@ -137,10 +137,12 @@ class WebsiteSettingsPopupView // The |TabbedPane| that contains the tabs of the Website Settings UI. views::TabbedPane* tabbed_pane_; + // The view that contains the permissions tab contents. + views::View* permissions_tab_; // The view that contains the contents of the "Cookies and Site data" section // from the "Permissions" tab. views::View* site_data_content_; - // The link that opend the "Cookies" dialog. + // The link that opens the "Cookies" dialog. views::Link* cookie_dialog_link_; // The view that contains the contents of the "Permissions" section from the // "Permissions" tab. @@ -148,7 +150,7 @@ class WebsiteSettingsPopupView // The view that contains the connection tab contents. views::View* connection_tab_; - // The view that contains the ui elements for displaying information about + // The view that contains the UI elements for displaying information about // the site's identity. views::View* identity_info_content_; // The link to open the certificate viewer for displaying the certificate @@ -163,10 +165,10 @@ class WebsiteSettingsPopupView // current host. views::LabelButton* reset_decisions_button_; - // The id of the certificate provided by the site. If the site does not + // The ID of the certificate provided by the site. If the site does not // provide a certificate then |cert_id_| is 0. int cert_id_; - // The IDs and validation status of Signed Certificate TImestamps provided + // The IDs and validation status of Signed Certificate Timestamps provided // by the site. Empty if no SCTs accompany the certificate. content::SignedCertificateTimestampIDStatusList signed_certificate_timestamp_ids_; @@ -175,6 +177,10 @@ class WebsiteSettingsPopupView // the connection status icons. views::Link* help_center_link_; + // The link to open the site settings page that provides full control over + // the origin's permissions. + views::Link* site_settings_link_; + views::View* connection_info_content_; views::View* page_info_content_; diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc index 2cb0a09..b86be9b 100644 --- a/chrome/browser/ui/website_settings/website_settings.cc +++ b/chrome/browser/ui/website_settings/website_settings.cc @@ -35,6 +35,7 @@ #include "components/content_settings/core/browser/content_settings_utils.h" #include "components/content_settings/core/browser/host_content_settings_map.h" #include "components/content_settings/core/browser/local_shared_objects_counter.h" +#include "components/content_settings/core/common/content_settings.h" #include "components/content_settings/core/common/content_settings_pattern.h" #include "content/public/browser/browser_thread.h" #include "content/public/browser/cert_store.h" @@ -68,19 +69,21 @@ enum SSLCertificateDecisionsDidRevoke { END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM }; -// The list of content settings types to display on the Website Settings UI. +// The list of content settings types to display on the Website Settings UI. THE +// ORDER OF THESE ITEMS IS IMPORTANT. To propose changing it, email +// security-dev@chromium.org. ContentSettingsType kPermissionType[] = { + CONTENT_SETTINGS_TYPE_GEOLOCATION, + CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, + CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, + CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTINGS_TYPE_IMAGES, CONTENT_SETTINGS_TYPE_JAVASCRIPT, - CONTENT_SETTINGS_TYPE_PLUGINS, CONTENT_SETTINGS_TYPE_POPUPS, - CONTENT_SETTINGS_TYPE_GEOLOCATION, - CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTINGS_TYPE_FULLSCREEN, - CONTENT_SETTINGS_TYPE_MOUSELOCK, - CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, - CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS, + CONTENT_SETTINGS_TYPE_PLUGINS, + CONTENT_SETTINGS_TYPE_MOUSELOCK, CONTENT_SETTINGS_TYPE_MIDI_SYSEX, #if defined(OS_ANDROID) CONTENT_SETTINGS_TYPE_PUSH_MESSAGING, @@ -693,7 +696,11 @@ void WebsiteSettings::PresentSitePermissions() { content_settings_->GetDefaultContentSetting(permission_info.type, NULL); } - permission_info_list.push_back(permission_info); + + if (permission_info.setting != CONTENT_SETTING_DEFAULT && + permission_info.setting != permission_info.default_setting) { + permission_info_list.push_back(permission_info); + } } ui_->SetPermissionInfo(permission_info_list); diff --git a/chrome/browser/ui/website_settings/website_settings.h b/chrome/browser/ui/website_settings/website_settings.h index a167c25..1263c51 100644 --- a/chrome/browser/ui/website_settings/website_settings.h +++ b/chrome/browser/ui/website_settings/website_settings.h @@ -83,6 +83,7 @@ class WebsiteSettings : public TabSpecificContentSettings::SiteDataObserver { WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED, WEBSITE_SETTINGS_TRANSPARENCY_VIEWER_OPENED, WEBSITE_SETTINGS_CONNECTION_HELP_OPENED, + WEBSITE_SETTINGS_SITE_SETTINGS_OPENED, WEBSITE_SETTINGS_COUNT }; diff --git a/chrome/browser/ui/website_settings/website_settings_ui.cc b/chrome/browser/ui/website_settings/website_settings_ui.cc index 5290c31..26c0737c 100644 --- a/chrome/browser/ui/website_settings/website_settings_ui.cc +++ b/chrome/browser/ui/website_settings/website_settings_ui.cc @@ -15,7 +15,7 @@ namespace { const int kInvalidResourceID = -1; -// The resource id's for the strings that are displayed on the permissions +// The resource IDs for the strings that are displayed on the permissions // button if the permission setting is managed by policy. const int kPermissionButtonTextIDPolicyManaged[] = { kInvalidResourceID, @@ -28,7 +28,7 @@ static_assert(arraysize(kPermissionButtonTextIDPolicyManaged) == CONTENT_SETTING_NUM_SETTINGS, "kPermissionButtonTextIDPolicyManaged array size is incorrect"); -// The resource id's for the strings that are displayed on the permissions +// The resource IDs for the strings that are displayed on the permissions // button if the permission setting is managed by an extension. const int kPermissionButtonTextIDExtensionManaged[] = { kInvalidResourceID, @@ -42,7 +42,7 @@ static_assert(arraysize(kPermissionButtonTextIDExtensionManaged) == "kPermissionButtonTextIDExtensionManaged array size is " "incorrect"); -// The resource id's for the strings that are displayed on the permissions +// The resource IDs for the strings that are displayed on the permissions // button if the permission setting is managed by the user. const int kPermissionButtonTextIDUserManaged[] = { kInvalidResourceID, @@ -55,7 +55,7 @@ static_assert(arraysize(kPermissionButtonTextIDUserManaged) == CONTENT_SETTING_NUM_SETTINGS, "kPermissionButtonTextIDUserManaged array size is incorrect"); -// The resource id's for the strings that are displayed on the permissions +// The resource IDs for the strings that are displayed on the permissions // button if the permission setting is the global default setting. const int kPermissionButtonTextIDDefaultSetting[] = { kInvalidResourceID, diff --git a/chrome/browser/ui/website_settings/website_settings_ui.h b/chrome/browser/ui/website_settings/website_settings_ui.h index e81ffe0..912cf3f 100644 --- a/chrome/browser/ui/website_settings/website_settings_ui.h +++ b/chrome/browser/ui/website_settings/website_settings_ui.h @@ -76,7 +76,9 @@ class WebsiteSettingsUI { IdentityInfo(); ~IdentityInfo(); - // The site's identity. + // The site's identity: the certificate's Organization Name for sites with + // Extended Validation certificates, or the URL's hostname for all other + // sites. std::string site_identity; // Status of the site's identity. WebsiteSettings::SiteIdentityStatus identity_status; @@ -104,6 +106,7 @@ class WebsiteSettingsUI { }; typedef std::vector<CookieInfo> CookieInfoList; + typedef std::vector<PermissionInfo> PermissionInfoList; virtual ~WebsiteSettingsUI(); diff --git a/chrome/common/url_constants.cc b/chrome/common/url_constants.cc index a3aedca..5dc987a 100644 --- a/chrome/common/url_constants.cc +++ b/chrome/common/url_constants.cc @@ -76,6 +76,7 @@ const char kChromeUIPrintURL[] = "chrome://print/"; const char kChromeUIQuitURL[] = "chrome://quit/"; const char kChromeUIRestartURL[] = "chrome://restart/"; const char kChromeUISettingsURL[] = "chrome://settings/"; +const char kChromeUIContentSettingsURL[] = "chrome://settings/content"; const char kChromeUISettingsFrameURL[] = "chrome://settings-frame/"; const char kChromeUISSLClientCertificateSelectorURL[] = "chrome://select-cert/"; const char kChromeUISuggestions[] = "chrome://suggestions/"; diff --git a/chrome/common/url_constants.h b/chrome/common/url_constants.h index 7fddc01..adfbeb5 100644 --- a/chrome/common/url_constants.h +++ b/chrome/common/url_constants.h @@ -72,6 +72,7 @@ extern const char kChromeUIRestartURL[]; extern const char kChromeUISessionFaviconURL[]; extern const char kChromeUIMdSettingsURL[]; extern const char kChromeUISettingsURL[]; +extern const char kChromeUIContentSettingsURL[]; extern const char kChromeUISettingsFrameURL[]; extern const char kChromeUISuggestions[]; extern const char kChromeUISuggestionsInternalsURL[]; diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index fbb14f4..281f4d9 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -59490,6 +59490,7 @@ To add a new entry, add it with any value and run test to compute valid value. <int value="6" label="Certificate dialog opened"/> <int value="7" label="Transparency viewer opened"/> <int value="8" label="Connection help opened"/> + <int value="9" label="Site settings opened"/> </enum> <enum name="WebSocketHandshakeResult" type="int"> |