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

Unified Diff: ash/wm/window_cycle_controller.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/wm/panels/panel_window_event_handler.cc ('k') | ash/wm/workspace/workspace_event_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_cycle_controller.cc
diff --git a/ash/wm/window_cycle_controller.cc b/ash/wm/window_cycle_controller.cc
index 157b09df2abd8c0e4493be24c344f0b0eec7c9eb..5c37562341272bddc6778831ddfdc6f18b982d5b 100644
--- a/ash/wm/window_cycle_controller.cc
+++ b/ash/wm/window_cycle_controller.cc
@@ -7,7 +7,6 @@
#include "ash/common/session/session_state_delegate.h"
#include "ash/common/wm/mru_window_tracker.h"
#include "ash/common/wm_shell.h"
-#include "ash/metrics/user_metrics_recorder.h"
#include "ash/shell.h"
#include "ash/wm/window_cycle_list.h"
#include "base/metrics/histogram.h"
@@ -71,11 +70,10 @@ WindowCycleController::~WindowCycleController() {
// static
bool WindowCycleController::CanCycle() {
- // Don't allow window cycling if the screen is locked or a modal dialog is
- // open.
- return !Shell::GetInstance()->session_state_delegate()->IsScreenLocked() &&
- !WmShell::Get()->IsSystemModalWindowOpen() &&
- !WmShell::Get()->IsPinned();
+ // Prevent window cycling if the screen is locked or a modal dialog is open.
+ WmShell* wm_shell = WmShell::Get();
+ return !wm_shell->GetSessionStateDelegate()->IsScreenLocked() &&
+ !wm_shell->IsSystemModalWindowOpen() && !wm_shell->IsPinned();
}
void WindowCycleController::HandleCycleWindow(Direction direction) {
@@ -97,7 +95,7 @@ void WindowCycleController::StartCycling() {
window_cycle_list_.reset(new WindowCycleList(window_list));
event_handler_.reset(new WindowCycleEventFilter());
cycle_start_time_ = base::Time::Now();
- Shell::GetInstance()->metrics()->RecordUserMetricsAction(UMA_WINDOW_CYCLE);
+ WmShell::Get()->RecordUserMetricsAction(UMA_WINDOW_CYCLE);
}
//////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « ash/wm/panels/panel_window_event_handler.cc ('k') | ash/wm/workspace/workspace_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698