Bug 1238137 - Telemetry pings for main thread scrollbar-driven scroll input methods. r=kats

--HG--
extra : commitid : GhlyvPny7Af
extra : rebase_source : 56705246d76aeba3ea3db32a8a672cf560f4aece
extra : amend_source : 856aef19ec8f8711759d2e9ffc06ffc971b1130c
extra : histedit_source : db4efe5b05499a019d76d8655b862815026029c8
This commit is contained in:
Botond Ballo 2016-02-05 16:21:54 -05:00
Родитель 45d03919dc
Коммит 17ea77b2cf
2 изменённых файлов: 16 добавлений и 0 удалений

Просмотреть файл

@ -22,8 +22,11 @@
#include "nsRepeatService.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/ScrollInputMethods.h"
using namespace mozilla;
using mozilla::layers::ScrollInputMethod;
//
// NS_NewToolbarFrame
@ -167,6 +170,10 @@ nsScrollbarButtonFrame::HandleButtonPress(nsPresContext* aPresContext,
if (!weakFrame.IsAlive()) {
return false;
}
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollbarButtonClick);
if (!m) {
sb->MoveToNewPosition();
if (!weakFrame.IsAlive()) {

Просмотреть файл

@ -36,13 +36,16 @@
#include "mozilla/Preferences.h"
#include "mozilla/LookAndFeel.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Telemetry.h"
#include "mozilla/layers/AsyncDragMetrics.h"
#include "mozilla/layers/InputAPZContext.h"
#include "mozilla/layers/ScrollInputMethods.h"
#include <algorithm>
using namespace mozilla;
using mozilla::layers::AsyncDragMetrics;
using mozilla::layers::InputAPZContext;
using mozilla::layers::ScrollInputMethod;
bool nsSliderFrame::gMiddlePref = false;
int32_t nsSliderFrame::gSnapMultiplier;
@ -513,6 +516,9 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollbarDrag);
// take our current position and subtract the start location
pos -= mDragStart;
bool isMouseOutsideThumb = false;
@ -579,6 +585,9 @@ nsSliderFrame::HandleEvent(nsPresContext* aPresContext,
nsSize thumbSize = thumbFrame->GetSize();
nscoord thumbLength = isHorizontal ? thumbSize.width : thumbSize.height;
mozilla::Telemetry::Accumulate(mozilla::Telemetry::SCROLL_INPUT_METHODS,
(uint32_t) ScrollInputMethod::MainThreadScrollbarTrackClick);
// set it
nsWeakFrame weakFrame(this);
// should aMaySnap be true here?