Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(903)

Unified Diff: chrome/browser/ui/views/message_center/web_notification_tray.cc

Issue 23636010: Notifications: Add cross-platform UMA: ShowMessageCenter, ShowSettings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added the hash to chromeactions.txt Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/message_center/web_notification_tray.cc
diff --git a/chrome/browser/ui/views/message_center/web_notification_tray.cc b/chrome/browser/ui/views/message_center/web_notification_tray.cc
index ac31aa9198088f5cf556b29db1995973b3c30814..f58482a0584a6ae7ec3dc84faf47a2c25f3e7ed1 100644
--- a/chrome/browser/ui/views/message_center/web_notification_tray.cc
+++ b/chrome/browser/ui/views/message_center/web_notification_tray.cc
@@ -12,7 +12,6 @@
#include "chrome/browser/status_icons/status_icon_menu_model.h"
#include "chrome/browser/status_icons/status_tray.h"
#include "content/public/browser/notification_service.h"
-#include "content/public/browser/user_metrics.h"
#include "grit/chromium_strings.h"
#include "grit/theme_resources.h"
#include "grit/ui_strings.h"
@@ -63,8 +62,6 @@ gfx::ImageSkia* GetIcon(int unread_count, bool is_quiet_mode) {
} // namespace
-using content::UserMetricsAction;
-
namespace message_center {
namespace internal {
@@ -161,25 +158,16 @@ bool WebNotificationTray::ShowPopups() {
void WebNotificationTray::HidePopups() { popup_collection_.reset(); }
-bool WebNotificationTray::ShowMessageCenterInternal(bool show_settings) {
- content::RecordAction(UserMetricsAction("Notifications.ShowMessageCenter"));
-
- // Message center delegate will be set to NULL when the message center
- // widget's Close method is called so we don't need to worry about
- // use-after-free issues.
- message_center_delegate_ = new MessageCenterWidgetDelegate(
- this,
- message_center_tray_.get(),
- show_settings, // settings initally invisible
- GetPositionInfo());
+bool WebNotificationTray::ShowMessageCenter() {
+ message_center_delegate_ =
+ new MessageCenterWidgetDelegate(this,
+ message_center_tray_.get(),
+ false, // settings initally invisible
+ GetPositionInfo());
return true;
}
-bool WebNotificationTray::ShowMessageCenter() {
- return ShowMessageCenterInternal(/*show_settings =*/false);
-}
-
void WebNotificationTray::HideMessageCenter() {
if (message_center_delegate_) {
views::Widget* widget = message_center_delegate_->GetWidget();
@@ -193,7 +181,13 @@ bool WebNotificationTray::ShowNotifierSettings() {
message_center_delegate_->SetSettingsVisible(true);
return true;
}
- return ShowMessageCenterInternal(/*show_settings =*/true);
+ message_center_delegate_ =
+ new MessageCenterWidgetDelegate(this,
+ message_center_tray_.get(),
+ true, // settings initally visible
+ GetPositionInfo());
+
+ return true;
}
void WebNotificationTray::OnMessageCenterTrayChanged() {
« no previous file with comments | « chrome/browser/ui/views/message_center/web_notification_tray.h ('k') | tools/metrics/actions/chromeactions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698