Chromium Code Reviews| Index: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc |
| 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 35f98c29802d8e508f7191e649f402f74fbc55a6..f6e7418ce280d25406b2788bdecb053ab77867d7 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 |
| @@ -390,16 +390,20 @@ void WebsiteSettingsPopupView::LinkClicked(views::Link* source, |
| int event_flags) { |
| if (source == cookie_dialog_link_) { |
| // Count how often the Collected Cookies dialog is opened. |
| - content::RecordAction( |
| - base::UserMetricsAction("WebsiteSettings_CookiesDialogOpened")); |
| + presenter_->RecordWebsiteSettingsAction( |
| + WebsiteSettings::WEBSITE_SETTINGS_COOKIES_DIALOG_OPENED); |
| new CollectedCookiesViews(web_contents_); |
| } else if (source == certificate_dialog_link_) { |
| gfx::NativeWindow parent = GetAnchorView() ? |
| GetAnchorView()->GetWidget()->GetNativeWindow() : NULL; |
| + presenter_->RecordWebsiteSettingsAction( |
| + WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED); |
| ShowCertificateViewerByID(web_contents_, parent, cert_id_); |
| } else if (source == signed_certificate_timestamps_link_) { |
| chrome::ShowSignedCertificateTimestampsViewer( |
| web_contents_, signed_certificate_timestamp_ids_); |
| + presenter_->RecordWebsiteSettingsAction( |
| + WebsiteSettings::WEBSITE_SETTINGS_TRANSPARENCY_VIEWER_OPENED); |
| } else if (source == help_center_link_) { |
| browser_->OpenURL( |
| content::OpenURLParams(GURL(chrome::kPageInfoHelpCenterURL), |
| @@ -407,10 +411,32 @@ void WebsiteSettingsPopupView::LinkClicked(views::Link* source, |
| NEW_FOREGROUND_TAB, |
| ui::PAGE_TRANSITION_LINK, |
| false)); |
| + presenter_->RecordWebsiteSettingsAction( |
| + WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_HELP_OPENED); |
| } |
| } |
| void WebsiteSettingsPopupView::TabSelectedAt(int index) { |
| + switch (index) { |
| + case TAB_ID_PERMISSIONS: { |
| + presenter_->RecordWebsiteSettingsAction( |
| + WebsiteSettings::WEBSITE_SETTINGS_PERMISSIONS_TAB_SELECTED); |
| + break; |
| + } |
|
Ilya Sherman
2014/10/29 23:55:42
nit: No need for curly braces for case stmts.
lgarron
2014/10/31 00:50:47
Acknowledged.
|
| + case TAB_ID_CONNECTION: { |
| + // If the Connection tab is selected first, we're still inside the |
| + // construction of presenter_. In that case, the action is already logged |
| + // by WEBSITE_SETTINGS_CONNECTION_TAB_SHOWN_IMMEDIATELY. |
| + if (presenter_) { |
| + presenter_->RecordWebsiteSettingsAction( |
| + WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_TAB_SELECTED); |
| + } |
| + break; |
| + } |
| + default: { |
| + assert(false); |
|
Ilya Sherman
2014/10/29 23:55:42
nit: Did you mean "NOTREACHED()"?
lgarron
2014/10/30 00:10:19
For this and the braces, I was following the C++ s
Ilya Sherman
2014/10/30 01:32:56
Note that the style guide says "case blocks in swi
lgarron
2014/10/31 00:50:47
Acknowledged.
|
| + } |
| + } |
| tabbed_pane_->GetSelectedTab()->Layout(); |
| SizeToContents(); |
| } |