Commit c0a685cd authored by haraken's avatar haraken Committed by Commit bot

Revert "Adding the following stylus metrics:"

This reverts commit 693c002f.

This CL broke compilation of Chrome OS Debug:

https://build.chromium.org/p/chromium.chromiumos/builders/Linux%20ChromiumOS%20Builder%20%28dbg%29/builds/78413

BUG=
TBR=xiaoyinh@chromium.org
NOTRY=true
NOPRESUBMIT=true
NOTREECHECKS=true

Review-Url: https://codereview.chromium.org/2271223003
Cr-Commit-Position: refs/heads/master@{#414311}
parent 1b5cbeed
......@@ -140,8 +140,6 @@ component("ash") {
"touch/touchscreen_util.h",
"virtual_keyboard_controller.cc",
"virtual_keyboard_controller.h",
"wm/stylus_metrics_recorder.cc",
"wm/stylus_metrics_recorder.h",
]
}
......
......@@ -776,8 +776,6 @@
'wm/session_state_animator_impl.h',
'wm/stacking_controller.cc',
'wm/stacking_controller.h',
'wm/stylus_metrics_recorder.cc',
'wm/stylus_metrics_recorder.h',
'wm/system_background_controller.cc',
'wm/system_background_controller.h',
'wm/system_gesture_event_filter.cc',
......@@ -1195,9 +1193,7 @@
'touch/touchscreen_util.cc',
'touch/touchscreen_util.h',
'virtual_keyboard_controller.cc',
'virtual_keyboard_controller.h',
'wm/stylus_metrics_recorder.cc',
'wm/stylus_metrics_recorder.h'
'virtual_keyboard_controller.h'
],
}],
],
......
......@@ -128,7 +128,6 @@
#include "ash/system/chromeos/power/video_activity_notifier.h"
#include "ash/touch/touch_transformer_controller.h"
#include "ash/virtual_keyboard_controller.h"
#include "ash/wm/stylus_metrics_recorder.h"
#include "base/bind_helpers.h"
#include "base/sys_info.h"
#include "chromeos/audio/audio_a11y_controller.h"
......@@ -553,9 +552,6 @@ Shell::~Shell() {
RemovePostTargetHandler(toplevel_window_event_handler_.get());
RemovePreTargetHandler(system_gesture_filter_.get());
RemovePreTargetHandler(mouse_cursor_filter_.get());
#if defined(OS_CHROMEOS)
RemovePreTargetHandler(stylus_metrics_recorder_.get());
#endif
RemovePreTargetHandler(modality_filter_.get());
// TooltipController is deleted with the Shell so removing its references.
......@@ -644,7 +640,9 @@ Shell::~Shell() {
#if defined(OS_CHROMEOS)
touch_transformer_controller_.reset();
stylus_metrics_recorder_.reset();
#endif // defined(OS_CHROMEOS)
#if defined(OS_CHROMEOS)
audio_a11y_controller_.reset();
#endif // defined(OS_CHROMEOS)
......@@ -866,14 +864,6 @@ void Shell::Init(const ShellInitParams& init_params) {
mouse_cursor_filter_.reset(new MouseCursorEventFilter());
PrependPreTargetHandler(mouse_cursor_filter_.get());
#if defined(OS_CHROMEOS)
// |stylus_metrics_recorder| records stylus metrics for certain events.
// It does not handle/consume any events, so prepend it as a pre-target hander
// before events are consumed elsewhere.
stylus_metrics_recorder_.reset(new StylusMetricsRecorder());
PrependPreTargetHandler(stylus_metrics_recorder_.get());
#endif
// Create Controllers that may need root window.
// TODO(oshima): Move as many controllers before creating
// RootWindowController as possible.
......
......@@ -120,7 +120,6 @@ struct ShellInitParams;
class SlowAnimationEventFilter;
class StatusAreaWidget;
class StickyKeysController;
class StylusMetricsRecorder;
class SystemGestureEventFilter;
class SystemModalContainerEventFilter;
class SystemTray;
......@@ -577,7 +576,6 @@ class ASH_EXPORT Shell : public SystemModalContainerEventFilterDelegate,
std::unique_ptr<ui::EventHandler> magnifier_key_scroll_handler_;
std::unique_ptr<ui::EventHandler> speech_feedback_handler_;
std::unique_ptr<StylusMetricsRecorder> stylus_metrics_recorder_;
#endif // defined(OS_CHROMEOS)
// |native_cursor_manager_| is owned by |cursor_manager_|, but we keep a
......
// Copyright 2016 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/wm/stylus_metrics_recorder.h"
#include "ash/common/wm/maximize_mode/maximize_mode_controller.h"
#include "ash/common/wm_shell.h"
#include "ash/shell.h"
#include "base/metrics/histogram.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_utils.h"
namespace ash {
// Form factor of the down event. This enum is used to back an UMA histogram
// and should be treated as append-only.
enum DownEventFormFactor {
DOWN_EVENT_FORMFACTOR_CLAMSHELL = 0,
DOWN_EVENT_FORMFACTOR_TOUCHVIEW,
DOWN_EVENT_FORMFACTOR_COUNT
};
// Input type of the down event. This enum is used to back an UMA histogram
// and should be treated as append-only.
enum DownEventSource {
DOWN_EVENT_SOURCE_UNKNOWN = 0,
DOWN_EVENT_SOURCE_MOUSE,
DOWN_EVENT_SOURCE_STYLUS,
DOWN_EVENT_SOURCE_TOUCH,
DOWN_EVENT_SOURCE_COUNT
};
StylusMetricsRecorder::StylusMetricsRecorder() {}
StylusMetricsRecorder::~StylusMetricsRecorder() {}
void StylusMetricsRecorder::OnMouseEvent(ui::MouseEvent* event) {
if (event->type() != ui::ET_MOUSE_PRESSED)
return;
RecordUMA(event->pointer_details().pointer_type);
}
void StylusMetricsRecorder::OnTouchEvent(ui::TouchEvent* event) {
if (event->type() != ui::ET_TOUCH_PRESSED)
return;
RecordUMA(event->pointer_details().pointer_type);
}
void StylusMetricsRecorder::RecordUMA(ui::EventPointerType type) {
DownEventFormFactor form_factor = DOWN_EVENT_FORMFACTOR_CLAMSHELL;
if (WmShell::Get()
->maximize_mode_controller()
->IsMaximizeModeWindowManagerEnabled()) {
form_factor = DOWN_EVENT_FORMFACTOR_TOUCHVIEW;
}
UMA_HISTOGRAM_ENUMERATION("Event.DownEventCount.PerFormFactor", form_factor,
DOWN_EVENT_FORMFACTOR_COUNT);
DownEventSource input_type = DOWN_EVENT_SOURCE_UNKNOWN;
switch (type) {
case ui::EventPointerType::POINTER_TYPE_UNKNOWN:
input_type = DOWN_EVENT_SOURCE_UNKNOWN;
break;
case ui::EventPointerType::POINTER_TYPE_MOUSE:
input_type = DOWN_EVENT_SOURCE_MOUSE;
break;
case ui::EventPointerType::POINTER_TYPE_PEN:
input_type = DOWN_EVENT_SOURCE_STYLUS;
break;
case ui::EventPointerType::POINTER_TYPE_TOUCH:
input_type = DOWN_EVENT_SOURCE_TOUCH;
break;
}
UMA_HISTOGRAM_ENUMERATION("Event.DownEventCount.PerInput", input_type,
DOWN_EVENT_SOURCE_COUNT);
}
} // namespace ash
// Copyright 2016 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_WM_STYLUS_METRICS_RECORDER_H_
#define ASH_WM_STYLUS_METRICS_RECORDER_H_
#include <memory>
#include "base/macros.h"
#include "ui/events/event_handler.h"
namespace ash {
// An event recorder that record stylus related metrics.
class StylusMetricsRecorder : public ui::EventHandler {
public:
StylusMetricsRecorder();
~StylusMetricsRecorder() override;
private:
// ui::EventHandler:
void OnMouseEvent(ui::MouseEvent* event) override;
void OnTouchEvent(ui::TouchEvent* event) override;
void RecordUMA(ui::EventPointerType type);
DISALLOW_COPY_AND_ASSIGN(StylusMetricsRecorder);
};
} // namespace ash
#endif // ASH_WM_STYLUS_METRICS_RECORDER_H_
......@@ -12759,20 +12759,6 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
<histogram name="Event.DownEventCount.PerFormFactor" enum="DownEventFormFactor">
<owner>xiaoyinh@chromium.org</owner>
<summary>
Counts the number of down events generated by clamshell/touchview.
</summary>
</histogram>
<histogram name="Event.DownEventCount.PerInput" enum="DownEventSource">
<owner>xiaoyinh@chromium.org</owner>
<summary>
Counts the number of down events generated by Mouse/Touch/Stylus.
</summary>
</histogram>
<histogram name="Event.DragDrop.Cancel" enum="DragDropEventSource">
<owner>mfomitchev@chromium.org</owner>
<summary>
......@@ -74095,18 +74081,6 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<int value="2" label="GET_NON_CACHABLE"/>
</enum>
<enum name="DownEventFormFactor" type="int">
<int value="0" label="Clamshell"/>
<int value="1" label="Touchview"/>
</enum>
<enum name="DownEventSource" type="int">
<int value="0" label="Unknown"/>
<int value="1" label="Mouse"/>
<int value="2" label="Stylus"/>
<int value="3" label="Touch"/>
</enum>
<enum name="DownloadContentDisposition" type="int">
<int value="0" label="Content-Disposition header present"/>
<int value="1" label="Valid"/>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment