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

Unified Diff: ash/system/tray/system_tray.cc

Issue 2099443002: Migrate simple ash Shell metrics users. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix win compile error. Created 4 years, 6 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
« no previous file with comments | « ash/system/overview/overview_button_tray.cc ('k') | ash/system/user/user_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/tray/system_tray.cc
diff --git a/ash/system/tray/system_tray.cc b/ash/system/tray/system_tray.cc
index 963618f7c695dde730703493c5087a5f45c73fc6..6c424cf06ce2f0444c2c16e0c9e79b1f396a28a7 100644
--- a/ash/system/tray/system_tray.cc
+++ b/ash/system/tray/system_tray.cc
@@ -19,7 +19,6 @@
#include "ash/common/wm_root_window_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
-#include "ash/metrics/user_metrics_recorder.h"
#include "ash/shell.h"
#include "ash/system/cast/tray_cast.h"
#include "ash/system/status_area_widget.h"
@@ -163,11 +162,11 @@ void SystemTray::InitializeTrayItems(SystemTrayDelegate* delegate) {
}
void SystemTray::CreateItems(SystemTrayDelegate* delegate) {
+ WmShell* wm_shell = WmShell::Get();
#if !defined(OS_WIN)
// Create user items for each possible user.
- ash::Shell* shell = ash::Shell::GetInstance();
int maximum_user_profiles =
- shell->session_state_delegate()->GetMaximumNumberOfLoggedInUsers();
+ wm_shell->GetSessionStateDelegate()->GetMaximumNumberOfLoggedInUsers();
for (int i = 0; i < maximum_user_profiles; i++)
AddTrayItem(new TrayUser(this, i));
@@ -215,9 +214,7 @@ void SystemTray::CreateItems(SystemTrayDelegate* delegate) {
AddTrayItem(tray_date_);
#endif
- SetVisible(ash::WmShell::Get()
- ->system_tray_delegate()
- ->GetTrayVisibilityOnStartup());
+ SetVisible(wm_shell->system_tray_delegate()->GetTrayVisibilityOnStartup());
}
void SystemTray::AddTrayItem(SystemTrayItem* item) {
@@ -438,10 +435,8 @@ int SystemTray::GetTrayXOffset(SystemTrayItem* item) const {
void SystemTray::ShowDefaultViewWithOffset(BubbleCreationType creation_type,
int arrow_offset,
bool persistent) {
- if (creation_type != BUBBLE_USE_EXISTING) {
- Shell::GetInstance()->metrics()->RecordUserMetricsAction(
- ash::UMA_STATUS_AREA_MENU_OPENED);
- }
+ if (creation_type != BUBBLE_USE_EXISTING)
+ WmShell::Get()->RecordUserMetricsAction(UMA_STATUS_AREA_MENU_OPENED);
ShowItems(items_.get(), false, true, creation_type, arrow_offset, persistent);
}
@@ -609,7 +604,7 @@ void SystemTray::UpdateWebNotifications() {
base::string16 SystemTray::GetAccessibleTimeString(
const base::Time& now) const {
base::HourClockType hour_type =
- ash::WmShell::Get()->system_tray_delegate()->GetHourClockType();
+ WmShell::Get()->system_tray_delegate()->GetHourClockType();
return base::TimeFormatTimeOfDayWithHourClockType(
now, hour_type, base::kKeepAmPm);
}
« no previous file with comments | « ash/system/overview/overview_button_tray.cc ('k') | ash/system/user/user_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698