summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjyasskin <jyasskin@chromium.org>2015-06-05 17:25:21 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-06 00:25:51 +0000
commit580afd414f1ba102a53eaa39bc670737efd4b3a6 (patch)
treea7d8c8c05a3ca6a179c08d3cbad11067c1fc2d71
parent038d10687396bcfca2361fa1f44189ccea0651b1 (diff)
downloadchromium_src-580afd414f1ba102a53eaa39bc670737efd4b3a6.zip
chromium_src-580afd414f1ba102a53eaa39bc670737efd4b3a6.tar.gz
chromium_src-580afd414f1ba102a53eaa39bc670737efd4b3a6.tar.bz2
Revert r333104: "Added UMA statistics for changing the active window via click or touch events."
This caused leaks in the ChromeOS valgrind bot: http://build.chromium.org/p/chromium.memory.fyi/builders/Chromium%20OS%20%28valgrind%29%283%29/builds/37831/steps/memory%20test%3A%20ash_unittests/logs/stdio Leak_DefinitelyLost 712 (136 direct, 576 indirect) bytes in 1 blocks are definitely lost in loss record 3,508 of 4,428 operator new(unsigned long) (m_replacemalloc/vg_replace_malloc.c:1140) ash::(anonymous namespace)::DesktopTaskSwitchMetricRecorderTest::CreateNonPositionableWindow() const (ash/metrics/desktop_task_switch_metric_recorder_unittest.cc:113) ash::(anonymous namespace)::DesktopTaskSwitchMetricRecorderTest_ActivateNonPositionableWindowBetweenTwoPositionableWindowActivations_Test::TestBody() (ash/metrics/desktop_task_switch_metric_recorder_unittest.cc:189) BUG=489813, 489814 TBR=bruthig@chromium.org Review URL: https://codereview.chromium.org/1165003010 Cr-Commit-Position: refs/heads/master@{#333185}
-rw-r--r--ash/ash.gyp3
-rw-r--r--ash/metrics/desktop_task_switch_metric_recorder.cc38
-rw-r--r--ash/metrics/desktop_task_switch_metric_recorder.h39
-rw-r--r--ash/metrics/desktop_task_switch_metric_recorder_unittest.cc338
-rw-r--r--ash/metrics/task_switch_metrics_recorder.cc5
-rw-r--r--ash/metrics/task_switch_metrics_recorder.h8
-rw-r--r--ash/metrics/task_switch_metrics_recorder_unittest.cc14
-rw-r--r--ash/metrics/user_metrics_recorder.cc19
-rw-r--r--ash/metrics/user_metrics_recorder.h15
-rw-r--r--ash/shell.cc4
-rw-r--r--tools/metrics/actions/actions.xml9
-rw-r--r--tools/metrics/histograms/histograms.xml14
12 files changed, 0 insertions, 506 deletions
diff --git a/ash/ash.gyp b/ash/ash.gyp
index bb33bfb..6ef24a1 100644
--- a/ash/ash.gyp
+++ b/ash/ash.gyp
@@ -168,8 +168,6 @@
'magnifier/magnification_controller.h',
'magnifier/partial_magnification_controller.cc',
'magnifier/partial_magnification_controller.h',
- 'metrics/desktop_task_switch_metric_recorder.cc',
- 'metrics/desktop_task_switch_metric_recorder.h',
'metrics/task_switch_metrics_recorder.cc',
'metrics/task_switch_metrics_recorder.h',
'metrics/task_switch_time_tracker.cc',
@@ -817,7 +815,6 @@
'keyboard_overlay/keyboard_overlay_delegate_unittest.cc',
'keyboard_overlay/keyboard_overlay_view_unittest.cc',
'magnifier/magnification_controller_unittest.cc',
- 'metrics/desktop_task_switch_metric_recorder_unittest.cc',
'metrics/task_switch_metrics_recorder_unittest.cc',
'metrics/task_switch_time_tracker_unittest.cc',
'metrics/user_metrics_recorder_unittest.cc',
diff --git a/ash/metrics/desktop_task_switch_metric_recorder.cc b/ash/metrics/desktop_task_switch_metric_recorder.cc
deleted file mode 100644
index 8936066..0000000
--- a/ash/metrics/desktop_task_switch_metric_recorder.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/metrics/desktop_task_switch_metric_recorder.h"
-
-#include "ash/metrics/user_metrics_recorder.h"
-#include "ash/shell.h"
-#include "ash/wm/window_util.h"
-#include "ui/wm/public/activation_client.h"
-
-namespace ash {
-
-DesktopTaskSwitchMetricRecorder::DesktopTaskSwitchMetricRecorder()
- : last_active_task_window_(nullptr) {
- Shell::GetInstance()->activation_client()->AddObserver(this);
-}
-
-DesktopTaskSwitchMetricRecorder::~DesktopTaskSwitchMetricRecorder() {
- Shell::GetInstance()->activation_client()->RemoveObserver(this);
-}
-
-void DesktopTaskSwitchMetricRecorder::OnWindowActivated(
- aura::client::ActivationChangeObserver::ActivationReason reason,
- aura::Window* gained_active,
- aura::Window* lost_active) {
- if (gained_active && wm::IsWindowUserPositionable(gained_active)) {
- if (last_active_task_window_ != gained_active &&
- reason == aura::client::ActivationChangeObserver::ActivationReason::
- INPUT_EVENT) {
- Shell::GetInstance()->metrics()->RecordUserMetricsAction(
- UMA_DESKTOP_SWITCH_TASK);
- }
- last_active_task_window_ = gained_active;
- }
-}
-
-} // namespace ash
diff --git a/ash/metrics/desktop_task_switch_metric_recorder.h b/ash/metrics/desktop_task_switch_metric_recorder.h
deleted file mode 100644
index 67bbb00..0000000
--- a/ash/metrics/desktop_task_switch_metric_recorder.h
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_
-#define ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_
-
-#include "ash/ash_export.h"
-#include "base/macros.h"
-#include "ui/wm/public/activation_change_observer.h"
-
-namespace ash {
-
-class UserMetricsRecorder;
-
-// Tracks metrics for task switches caused by the user activating a task window
-// by clicking or tapping on it.
-class ASH_EXPORT DesktopTaskSwitchMetricRecorder
- : public aura::client::ActivationChangeObserver {
- public:
- explicit DesktopTaskSwitchMetricRecorder();
- ~DesktopTaskSwitchMetricRecorder() override;
-
- // aura::client::ActivationChangeObserver:
- void OnWindowActivated(
- aura::client::ActivationChangeObserver::ActivationReason reason,
- aura::Window* gained_active,
- aura::Window* lost_active) override;
-
- private:
- // Tracks the last active task window.
- aura::Window* last_active_task_window_;
-
- DISALLOW_COPY_AND_ASSIGN(DesktopTaskSwitchMetricRecorder);
-};
-
-} // namespace ash
-
-#endif // ASH_METRICS_DESKTOP_TASK_SWITCH_METRIC_RECORDER_H_
diff --git a/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc b/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc
deleted file mode 100644
index 741407f..0000000
--- a/ash/metrics/desktop_task_switch_metric_recorder_unittest.cc
+++ /dev/null
@@ -1,338 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ash/metrics/desktop_task_switch_metric_recorder.h"
-
-#include "ash/shell.h"
-#include "ash/test/ash_test_base.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/test/user_action_tester.h"
-#include "ui/aura/test/test_window_delegate.h"
-#include "ui/aura/window.h"
-#include "ui/compositor/layer_type.h"
-#include "ui/events/test/event_generator.h"
-#include "ui/wm/public/activation_client.h"
-#include "ui/wm/public/window_types.h"
-
-using aura::client::ActivationChangeObserver;
-
-namespace ash {
-namespace {
-
-const char kDesktopTaskSwitchUserAction[] = "Desktop_SwitchTask";
-
-// Test fixture for the DesktopTaskSwitchMetricsRecorder class. NOTE: This
-// fixture extends AshTestBase so that the UserMetricsRecorder instance required
-// by the test target can be obtained through Shell::GetInstance()->metrics()
-// and the test target is not the same instance as the one owned by the
-// UserMetricsRecorder instance.
-class DesktopTaskSwitchMetricRecorderTest : public test::AshTestBase {
- public:
- DesktopTaskSwitchMetricRecorderTest();
- ~DesktopTaskSwitchMetricRecorderTest() override;
-
- // test::AshTestBase:
- void SetUp() override;
- void TearDown() override;
-
- // Resets the recorded user action counts.
- void ResetActionCounts();
-
- // Returns the number of times the "Desktop_SwitchTask" user action was
- // recorded.
- int GetActionCount() const;
-
- // Creates a positionable window such that wm::IsWindowUserPositionable(...)
- // would retun true.
- scoped_ptr<aura::Window> CreatePositionableWindow() const;
-
- // Creates a non-positionable window such that
- // wm::IsWindowUserPositionable(...) would retun false.
- scoped_ptr<aura::Window> CreateNonPositionableWindow() const;
-
- // Wrapper to notify the test target's OnWindowActivated(...) method that
- // |window| was activated due to an INPUT_EVENT.
- void ActiveTaskWindowWithUserInput(aura::Window* window);
-
- protected:
- // Records UMA user action counts.
- scoped_ptr<base::UserActionTester> user_action_tester_;
-
- // The test target.
- scoped_ptr<DesktopTaskSwitchMetricRecorder> metrics_recorder_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(DesktopTaskSwitchMetricRecorderTest);
-};
-
-DesktopTaskSwitchMetricRecorderTest::DesktopTaskSwitchMetricRecorderTest() {
-}
-
-DesktopTaskSwitchMetricRecorderTest::~DesktopTaskSwitchMetricRecorderTest() {
-}
-
-void DesktopTaskSwitchMetricRecorderTest::SetUp() {
- test::AshTestBase::SetUp();
- metrics_recorder_.reset(new DesktopTaskSwitchMetricRecorder);
- user_action_tester_.reset(new base::UserActionTester);
-}
-
-void DesktopTaskSwitchMetricRecorderTest::TearDown() {
- user_action_tester_.reset();
- metrics_recorder_.reset();
- test::AshTestBase::TearDown();
-}
-
-void DesktopTaskSwitchMetricRecorderTest::ActiveTaskWindowWithUserInput(
- aura::Window* window) {
- metrics_recorder_->OnWindowActivated(
- ActivationChangeObserver::ActivationReason::INPUT_EVENT, window, nullptr);
-}
-
-void DesktopTaskSwitchMetricRecorderTest::ResetActionCounts() {
- user_action_tester_->ResetCounts();
-}
-
-int DesktopTaskSwitchMetricRecorderTest::GetActionCount() const {
- return user_action_tester_->GetActionCount(kDesktopTaskSwitchUserAction);
-}
-
-scoped_ptr<aura::Window>
-DesktopTaskSwitchMetricRecorderTest::CreatePositionableWindow() const {
- scoped_ptr<aura::Window> window(
- new aura::Window(new aura::test::TestWindowDelegate));
- window->SetType(ui::wm::WINDOW_TYPE_NORMAL);
- window->Init(ui::LAYER_NOT_DRAWN);
- return window.Pass();
-}
-
-scoped_ptr<aura::Window>
-DesktopTaskSwitchMetricRecorderTest::CreateNonPositionableWindow() const {
- scoped_ptr<aura::Window> window(
- new aura::Window(new aura::test::TestWindowDelegate));
- window->SetType(ui::wm::WINDOW_TYPE_UNKNOWN);
- window->Init(ui::LAYER_NOT_DRAWN);
- return window.Pass();
-}
-
-// Verify user action is recorded when a positionable window is activated given
-// that a null window was activated last.
-TEST_F(DesktopTaskSwitchMetricRecorderTest,
- ActivatePositionableWindowWhenNullWindowWasActivatedLast) {
- scoped_ptr<aura::Window> null_window;
- scoped_ptr<aura::Window> positionable_window =
- CreatePositionableWindow().Pass();
-
- ActiveTaskWindowWithUserInput(null_window.get());
- ResetActionCounts();
-
- ActiveTaskWindowWithUserInput(positionable_window.get());
- EXPECT_EQ(1, GetActionCount());
-}
-
-// Verify user action is recorded whena positionable window is activated given
-// a different positionable window was activated last.
-TEST_F(
- DesktopTaskSwitchMetricRecorderTest,
- ActivatePositionableWindowWhenADifferentPositionableWindowWasActivatedLast) {
- scoped_ptr<aura::Window> positionable_window_1 =
- CreatePositionableWindow().Pass();
- scoped_ptr<aura::Window> positionable_window_2 =
- CreatePositionableWindow().Pass();
-
- ActiveTaskWindowWithUserInput(positionable_window_1.get());
- ResetActionCounts();
-
- ActiveTaskWindowWithUserInput(positionable_window_2.get());
- EXPECT_EQ(1, GetActionCount());
-}
-
-// Verify user action is not recorded when a positionable window is activated
-// given the same positionable window was activated last.
-TEST_F(
- DesktopTaskSwitchMetricRecorderTest,
- ActivatePositionableWindowWhenTheSamePositionableWindowWasActivatedLast) {
- scoped_ptr<aura::Window> positionable_window =
- CreatePositionableWindow().Pass();
-
- ActiveTaskWindowWithUserInput(positionable_window.get());
- ResetActionCounts();
-
- ActiveTaskWindowWithUserInput(positionable_window.get());
- EXPECT_EQ(0, GetActionCount());
-}
-
-// Verify user action is recorded when a positionable window is activated given
-// a non-positionable window was activated last.
-TEST_F(DesktopTaskSwitchMetricRecorderTest,
- ActivatePositionableWindowWhenANonPositionableWindowWasActivatedLast) {
- scoped_ptr<aura::Window> non_positionable_window =
- CreateNonPositionableWindow().Pass();
- scoped_ptr<aura::Window> positionable_window =
- CreatePositionableWindow().Pass();
-
- ActiveTaskWindowWithUserInput(non_positionable_window.get());
- ResetActionCounts();
-
- ActiveTaskWindowWithUserInput(positionable_window.get());
- EXPECT_EQ(1, GetActionCount());
-}
-
-// Verify user action is not recorded when a non-positionable window is
-// activated between two activations of the same positionable window.
-TEST_F(DesktopTaskSwitchMetricRecorderTest,
- ActivateNonPositionableWindowBetweenTwoPositionableWindowActivations) {
- scoped_ptr<aura::Window> positionable_window =
- CreatePositionableWindow().Pass();
- scoped_ptr<aura::Window> non_positionable_window =
- CreateNonPositionableWindow().Pass();
-
- ActiveTaskWindowWithUserInput(positionable_window.get());
- ResetActionCounts();
-
- ActiveTaskWindowWithUserInput(non_positionable_window.get());
- EXPECT_EQ(0, GetActionCount());
-
- ActiveTaskWindowWithUserInput(positionable_window.get());
- EXPECT_EQ(0, GetActionCount());
-}
-
-// Verify user action is not recorded when a null window is activated.
-TEST_F(DesktopTaskSwitchMetricRecorderTest, ActivateNullWindow) {
- scoped_ptr<aura::Window> positionable_window =
- CreatePositionableWindow().Pass();
- scoped_ptr<aura::Window> null_window = nullptr;
-
- ActiveTaskWindowWithUserInput(positionable_window.get());
- ResetActionCounts();
-
- ActiveTaskWindowWithUserInput(null_window.get());
- EXPECT_EQ(0, GetActionCount());
-}
-
-// Verify user action is not recorded when a non-positionable window is
-// activated.
-TEST_F(DesktopTaskSwitchMetricRecorderTest, ActivateNonPositionableWindow) {
- scoped_ptr<aura::Window> positionable_window =
- CreatePositionableWindow().Pass();
- scoped_ptr<aura::Window> non_positionable_window =
- CreateNonPositionableWindow().Pass();
-
- ActiveTaskWindowWithUserInput(positionable_window.get());
- ResetActionCounts();
-
- ActiveTaskWindowWithUserInput(non_positionable_window.get());
- EXPECT_EQ(0, GetActionCount());
-}
-
-// Verify user action is not recorded when the ActivationReason is not an
-// INPUT_EVENT.
-TEST_F(DesktopTaskSwitchMetricRecorderTest,
- ActivatePositionableWindowWithNonInputEventReason) {
- scoped_ptr<aura::Window> positionable_window_1 =
- CreatePositionableWindow().Pass();
- scoped_ptr<aura::Window> positionable_window_2 =
- CreatePositionableWindow().Pass();
-
- ActiveTaskWindowWithUserInput(positionable_window_1.get());
- ResetActionCounts();
-
- metrics_recorder_->OnWindowActivated(
- ActivationChangeObserver::ActivationReason::ACTIVATION_CLIENT,
- positionable_window_2.get(), nullptr);
- EXPECT_EQ(0, GetActionCount());
-}
-
-// Test fixture to test the integration of the DesktopTaskSwitchMetricsRecorder
-// class with ash::Shell environment.
-class DesktopTaskSwitchMetricRecorderWithShellIntegrationTest
- : public test::AshTestBase {
- public:
- DesktopTaskSwitchMetricRecorderWithShellIntegrationTest();
- ~DesktopTaskSwitchMetricRecorderWithShellIntegrationTest() override;
-
- // test::AshTestBase:
- void SetUp() override;
- void TearDown() override;
-
- // Returns the number of times the "Desktop_SwitchTask" user action was
- // recorded.
- int GetActionCount() const;
-
- // Creates a positionable window with the given |bounds| such that
- // wm::IsWindowUserPositionable(...) would retun true.
- aura::Window* CreatePositionableWindowInShellWithBounds(
- const gfx::Rect& bounds);
-
- protected:
- // Records UMA user action counts.
- scoped_ptr<base::UserActionTester> user_action_tester_;
-
- // Delegate used when creating new windows using the
- // CreatePositionableWindowInShellWithBounds(...) method.
- aura::test::TestWindowDelegate test_window_delegate_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(
- DesktopTaskSwitchMetricRecorderWithShellIntegrationTest);
-};
-
-DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::
- DesktopTaskSwitchMetricRecorderWithShellIntegrationTest() {
-}
-
-DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::
- ~DesktopTaskSwitchMetricRecorderWithShellIntegrationTest() {
-}
-
-void DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::SetUp() {
- test::AshTestBase::SetUp();
- user_action_tester_.reset(new base::UserActionTester);
-}
-
-void DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::TearDown() {
- user_action_tester_.reset();
- test::AshTestBase::TearDown();
-}
-
-int DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::GetActionCount()
- const {
- return user_action_tester_->GetActionCount(kDesktopTaskSwitchUserAction);
-}
-
-aura::Window* DesktopTaskSwitchMetricRecorderWithShellIntegrationTest::
- CreatePositionableWindowInShellWithBounds(const gfx::Rect& bounds) {
- return CreateTestWindowInShellWithDelegate(&test_window_delegate_, 0, bounds);
-}
-
-// Verify a user action is recorded when a positionable window is activated by
-// a INPUT_EVENT.
-TEST_F(DesktopTaskSwitchMetricRecorderWithShellIntegrationTest,
- ActivatePositionableWindowWithInputEvent) {
- aura::Window* positionable_window =
- CreatePositionableWindowInShellWithBounds(gfx::Rect(0, 0, 10, 10));
-
- ui::test::EventGenerator event_generator(Shell::GetPrimaryRootWindow());
-
- event_generator.MoveMouseToCenterOf(positionable_window);
- event_generator.ClickLeftButton();
-
- EXPECT_EQ(1, GetActionCount());
-}
-
-// Verify a user action is not recorded when a positionable window is activated
-// by a non INPUT_EVENT.
-TEST_F(DesktopTaskSwitchMetricRecorderWithShellIntegrationTest,
- ActivatePositionableWindowWithNonInputEvent) {
- aura::Window* positionable_window =
- CreatePositionableWindowInShellWithBounds(gfx::Rect(0, 0, 10, 10));
-
- Shell::GetInstance()->activation_client()->ActivateWindow(
- positionable_window);
-
- EXPECT_EQ(0, GetActionCount());
-}
-
-} // namespace
-} // namespace ash
diff --git a/ash/metrics/task_switch_metrics_recorder.cc b/ash/metrics/task_switch_metrics_recorder.cc
index 11ba222..b8b57fe 100644
--- a/ash/metrics/task_switch_metrics_recorder.cc
+++ b/ash/metrics/task_switch_metrics_recorder.cc
@@ -10,9 +10,6 @@ namespace ash {
namespace {
-const char kDesktopHistogramName[] =
- "Ash.Desktop.TimeBetweenNavigateToTaskSwitches";
-
const char kShelfHistogramName[] =
"Ash.Shelf.TimeBetweenNavigateToTaskSwitches";
@@ -33,8 +30,6 @@ const char* GetHistogramName(
switch (task_switch_source) {
case TaskSwitchMetricsRecorder::kAppList:
return kAppListHistogramName;
- case TaskSwitchMetricsRecorder::kDesktop:
- return kDesktopHistogramName;
case TaskSwitchMetricsRecorder::kOverviewMode:
return kOverviewModeHistogramName;
case TaskSwitchMetricsRecorder::kShelf:
diff --git a/ash/metrics/task_switch_metrics_recorder.h b/ash/metrics/task_switch_metrics_recorder.h
index 177ff08..b2103be 100644
--- a/ash/metrics/task_switch_metrics_recorder.h
+++ b/ash/metrics/task_switch_metrics_recorder.h
@@ -10,10 +10,6 @@
#include "ash/ash_export.h"
#include "base/containers/scoped_ptr_hash_map.h"
-namespace aura {
-class Window;
-} // namespace aura
-
namespace ash {
class TaskSwitchTimeTracker;
@@ -25,13 +21,9 @@ class ASH_EXPORT TaskSwitchMetricsRecorder {
public:
// Enumeration of the different user interfaces that could be the source of
// a task switch. Note this is not necessarily comprehensive of all sources.
- // TODO(bruthig): Convert enum format from kValue to VALUE.
enum TaskSwitchSource {
// Task switches from selecting items in the app list.
kAppList,
- // Task switches caused by the user activating a task window by clicking or
- // tapping on it.
- kDesktop,
// Task switches caused by selecting a window from overview mode which is
// different from the previously-active window.
kOverviewMode,
diff --git a/ash/metrics/task_switch_metrics_recorder_unittest.cc b/ash/metrics/task_switch_metrics_recorder_unittest.cc
index 0b3d03a..90a0db1 100644
--- a/ash/metrics/task_switch_metrics_recorder_unittest.cc
+++ b/ash/metrics/task_switch_metrics_recorder_unittest.cc
@@ -62,20 +62,6 @@ void TaskSwitchMetricsRecorderTest::TearDown() {
} // namespace
-// Verifies that the TaskSwitchMetricsRecorder::kDesktop source adds data to the
-// Ash.Desktop.TimeBetweenNavigateToTaskSwitches histogram.
-TEST_F(TaskSwitchMetricsRecorderTest, VerifyTaskSwitchesForDesktopAreRecorded) {
- const std::string kHistogramName =
- "Ash.Desktop.TimeBetweenNavigateToTaskSwitches";
-
- OnTaskSwitch(TaskSwitchMetricsRecorder::kDesktop);
- OnTaskSwitch(TaskSwitchMetricsRecorder::kDesktop);
- histogram_tester_->ExpectTotalCount(kHistogramName, 1);
-
- OnTaskSwitch(TaskSwitchMetricsRecorder::kDesktop);
- histogram_tester_->ExpectTotalCount(kHistogramName, 2);
-}
-
// Verifies that the TaskSwitchMetricsRecorder::kWindowCycleController source
// adds data to the Ash.WindowCycleController.TimeBetweenTaskSwitches histogram.
TEST_F(TaskSwitchMetricsRecorderTest,
diff --git a/ash/metrics/user_metrics_recorder.cc b/ash/metrics/user_metrics_recorder.cc
index 8229039..cfc4d8e 100644
--- a/ash/metrics/user_metrics_recorder.cc
+++ b/ash/metrics/user_metrics_recorder.cc
@@ -4,7 +4,6 @@
#include "ash/metrics/user_metrics_recorder.h"
-#include "ash/metrics/desktop_task_switch_metric_recorder.h"
#include "ash/session/session_state_delegate.h"
#include "ash/shelf/shelf_delegate.h"
#include "ash/shelf/shelf_item_types.h"
@@ -237,11 +236,6 @@ void UserMetricsRecorder::RecordUserMetricsAction(UserMetricsAction action) {
case ash::UMA_CLOSE_THROUGH_CONTEXT_MENU:
base::RecordAction(base::UserMetricsAction("CloseFromContextMenu"));
break;
- case ash::UMA_DESKTOP_SWITCH_TASK:
- base::RecordAction(base::UserMetricsAction("Desktop_SwitchTask"));
- task_switch_metrics_recorder_.OnTaskSwitch(
- TaskSwitchMetricsRecorder::kDesktop);
- break;
case ash::UMA_DRAG_MAXIMIZE_LEFT:
base::RecordAction(base::UserMetricsAction("WindowDrag_MaximizeLeft"));
break;
@@ -604,19 +598,6 @@ void UserMetricsRecorder::RecordUserMetricsAction(UserMetricsAction action) {
}
}
-void UserMetricsRecorder::OnShellInitialized() {
- // Lazy creation of the DesktopTaskSwitchMetricRecorder because it accesses
- // Shell::GetInstance() which is not available when |this| is instantiated.
- if (!desktop_task_switch_metric_recorder_) {
- desktop_task_switch_metric_recorder_.reset(
- new DesktopTaskSwitchMetricRecorder());
- }
-}
-
-void UserMetricsRecorder::OnShellShuttingDown() {
- desktop_task_switch_metric_recorder_.reset();
-}
-
void UserMetricsRecorder::RecordPeriodicMetrics() {
ShelfLayoutManager* manager =
ShelfLayoutManager::ForShelf(Shell::GetPrimaryRootWindow());
diff --git a/ash/metrics/user_metrics_recorder.h b/ash/metrics/user_metrics_recorder.h
index 0d22355..7bb6f9d 100644
--- a/ash/metrics/user_metrics_recorder.h
+++ b/ash/metrics/user_metrics_recorder.h
@@ -7,13 +7,10 @@
#include "ash/ash_export.h"
#include "ash/metrics/task_switch_metrics_recorder.h"
-#include "base/memory/scoped_ptr.h"
#include "base/timer/timer.h"
namespace ash {
-class DesktopTaskSwitchMetricRecorder;
-
namespace test {
class UserMetricsRecorderTestAPI;
}
@@ -30,7 +27,6 @@ enum UserMetricsAction {
UMA_ACCEL_RESTART_POWER_BUTTON,
UMA_ACCEL_SHUT_DOWN_POWER_BUTTON,
UMA_CLOSE_THROUGH_CONTEXT_MENU,
- UMA_DESKTOP_SWITCH_TASK,
UMA_DRAG_MAXIMIZE_LEFT,
UMA_DRAG_MAXIMIZE_RIGHT,
UMA_GESTURE_OVERVIEW,
@@ -157,12 +153,6 @@ class ASH_EXPORT UserMetricsRecorder {
return task_switch_metrics_recorder_;
}
- // Informs |this| that the Shell has been initialized.
- void OnShellInitialized();
-
- // Informs |this| that the Shell is going to be shut down.
- void OnShellShuttingDown();
-
private:
friend class test::UserMetricsRecorderTestAPI;
@@ -189,11 +179,6 @@ class ASH_EXPORT UserMetricsRecorder {
TaskSwitchMetricsRecorder task_switch_metrics_recorder_;
- // Metric recorder to track how often task windows are activated by mouse
- // clicks or touchscreen taps.
- scoped_ptr<DesktopTaskSwitchMetricRecorder>
- desktop_task_switch_metric_recorder_;
-
DISALLOW_COPY_AND_ASSIGN(UserMetricsRecorder);
};
diff --git a/ash/shell.cc b/ash/shell.cc
index 502f671..8393cda 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -660,8 +660,6 @@ Shell::Shell(ShellDelegate* delegate)
Shell::~Shell() {
TRACE_EVENT0("shutdown", "ash::Shell::Destructor");
- user_metrics_recorder_->OnShellShuttingDown();
-
delegate_->PreShutdown();
views::FocusManagerFactory::Install(NULL);
@@ -1087,8 +1085,6 @@ void Shell::Init(const ShellInitParams& init_params) {
// order to create mirror window. Run it after the main message loop
// is started.
display_manager_->CreateMirrorWindowAsyncIfAny();
-
- user_metrics_recorder_->OnShellInitialized();
}
void Shell::InitKeyboard() {
diff --git a/tools/metrics/actions/actions.xml b/tools/metrics/actions/actions.xml
index 54d94fe..0990180 100644
--- a/tools/metrics/actions/actions.xml
+++ b/tools/metrics/actions/actions.xml
@@ -2501,15 +2501,6 @@ should be able to be added at any place in this file.
<description>Please enter the description of this user action.</description>
</action>
-<action name="Desktop_SwitchTask">
- <owner>bruthig@google.com</owner>
- <owner>tdanderson@google.com</owner>
- <description>
- Recorded when the user activates an existing task window by clicking or
- tapping on it. Recorded on ChromeOS only.
- </description>
-</action>
-
<action name="Destination_Application_Edit">
<owner>Please list the metric's owners. Add more owner tags as needed.</owner>
<description>Please enter the description of this user action.</description>
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index 72378ca..0b2f33e 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -623,20 +623,6 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
-<histogram name="Ash.Desktop.TimeBetweenNavigateToTaskSwitches" units="seconds">
- <owner>bruthig@chromium.org</owner>
- <owner>tdanderson@chromium.org</owner>
- <summary>
- The number of seconds between task window activations triggered by users
- clicking or tapping on a window, as recorded by the Desktop_SwitchTask user
- action. Recorded on ChromeOS only. Task switches from other sources are
- ignored and do not affect this metric. In other words, if a user performs
- the following steps (1) click on task window 'A' (2) Alt+Tab to task 'Z'(3)
- click on task window 'B', then this will result in a sample recorded for the
- time delta between activating task window 'A'and 'B'.
- </summary>
-</histogram>
-
<histogram name="Ash.Dock.Action" enum="DockedAction">
<owner>kuscher@google.com</owner>
<owner>varkha@chromium.org</owner>