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

Unified Diff: ash/frame/caption_buttons/frame_size_button.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
Index: ash/frame/caption_buttons/frame_size_button.cc
diff --git a/ash/frame/caption_buttons/frame_size_button.cc b/ash/frame/caption_buttons/frame_size_button.cc
index 0dfa8c1b089e84e51c2e49bc7d285f0b4f0c657f..d45d87c574aee7553f563d48433a43f3f89b5a2e 100644
--- a/ash/frame/caption_buttons/frame_size_button.cc
+++ b/ash/frame/caption_buttons/frame_size_button.cc
@@ -9,15 +9,17 @@
#include "ash/common/wm/window_state.h"
#include "ash/common/wm/wm_event.h"
#include "ash/common/wm/workspace/phantom_window_controller.h"
-#include "ash/metrics/user_metrics_recorder.h"
+#include "ash/common/wm_shell.h"
#include "ash/screen_util.h"
-#include "ash/shell.h"
#include "ash/wm/window_state_aura.h"
#include "ash/wm/window_util.h"
#include "base/i18n/rtl.h"
+#include "ui/aura/window.h"
#include "ui/gfx/geometry/vector2d.h"
#include "ui/views/widget/widget.h"
+namespace ash {
+
namespace {
// The default delay between the user pressing the size button and the buttons
@@ -32,7 +34,7 @@ const int kMaxOvershootY = 50;
// Returns true if a mouse drag while in "snap mode" at |location_in_screen|
// would hover/press |button| or keep it hovered/pressed.
-bool HitTestButton(const ash::FrameCaptionButton* button,
+bool HitTestButton(const FrameCaptionButton* button,
const gfx::Point& location_in_screen) {
gfx::Rect expanded_bounds_in_screen = button->GetBoundsInScreen();
if (button->state() == views::Button::STATE_HOVERED ||
@@ -44,8 +46,6 @@ bool HitTestButton(const ash::FrameCaptionButton* button,
} // namespace
-namespace ash {
-
FrameSizeButton::FrameSizeButton(
views::ButtonListener* listener,
views::Widget* frame,
@@ -260,12 +260,11 @@ bool FrameSizeButton::CommitSnap(const ui::LocatedEvent& event) {
(snap_type_ == SNAP_LEFT || snap_type_ == SNAP_RIGHT)) {
wm::WindowState* window_state =
wm::GetWindowState(frame_->GetNativeWindow());
- UserMetricsRecorder* metrics = Shell::GetInstance()->metrics();
const wm::WMEvent snap_event(
snap_type_ == SNAP_LEFT ?
wm::WM_EVENT_SNAP_LEFT : wm::WM_EVENT_SNAP_RIGHT);
window_state->OnWMEvent(&snap_event);
- metrics->RecordUserMetricsAction(
+ WmShell::Get()->RecordUserMetricsAction(
snap_type_ == SNAP_LEFT ?
UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_LEFT :
UMA_WINDOW_MAXIMIZE_BUTTON_MAXIMIZE_RIGHT);
« no previous file with comments | « ash/frame/caption_buttons/frame_caption_button_container_view.cc ('k') | ash/metrics/desktop_task_switch_metric_recorder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698