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

Unified Diff: ash/metrics/user_metrics_recorder.cc

Issue 1743493002: Cleanup ash shelf accessor functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ash/shelf/shelf_widget.cc for browser_tests crash... Created 4 years, 10 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/focus_cycler_unittest.cc ('k') | ash/root_window_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/metrics/user_metrics_recorder.cc
diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc
index 040fc76b659475f2f68f0ce4ea4a4c650508bac0..df523b1c9c74d4608f26463ee3a28662de734ce6 100644
--- a/ash/metrics/user_metrics_recorder.cc
+++ b/ash/metrics/user_metrics_recorder.cc
@@ -6,12 +6,11 @@
#include "ash/metrics/desktop_task_switch_metric_recorder.h"
#include "ash/session/session_state_delegate.h"
+#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_delegate.h"
#include "ash/shelf/shelf_item_types.h"
-#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_model.h"
#include "ash/shelf/shelf_view.h"
-#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "ash/system/tray/system_tray_delegate.h"
@@ -622,18 +621,16 @@ void UserMetricsRecorder::OnShellShuttingDown() {
}
void UserMetricsRecorder::RecordPeriodicMetrics() {
- ShelfLayoutManager* manager =
- ShelfLayoutManager::ForShelf(Shell::GetPrimaryRootWindow());
+ Shelf* shelf = Shelf::ForPrimaryDisplay();
// TODO(bruthig): Investigating whether the check for |manager| is necessary
// and add tests if it is.
- if (manager) {
+ if (shelf) {
// TODO(bruthig): Consider tracking the time spent in each alignment.
UMA_HISTOGRAM_ENUMERATION("Ash.ShelfAlignmentOverTime",
- manager->SelectValueForShelfAlignment(
+ shelf->SelectValueForShelfAlignment(
SHELF_ALIGNMENT_UMA_ENUM_VALUE_BOTTOM,
SHELF_ALIGNMENT_UMA_ENUM_VALUE_LEFT,
- SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT,
- -1),
+ SHELF_ALIGNMENT_UMA_ENUM_VALUE_RIGHT, -1),
SHELF_ALIGNMENT_UMA_ENUM_VALUE_COUNT);
}
« no previous file with comments | « ash/focus_cycler_unittest.cc ('k') | ash/root_window_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698