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

Side by Side Diff: ash/wm/overview/window_overview.cc

Issue 24096024: Add UMA metrics for window selection and overview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Improve the wording of histogram descriptions and fix selection uma count. Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/overview/window_overview.h ('k') | ash/wm/overview/window_selector.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/overview/window_overview.h" 5 #include "ash/wm/overview/window_overview.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/screen_ash.h" 9 #include "ash/screen_ash.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "ash/shell_delegate.h"
11 #include "ash/shell_window_ids.h" 12 #include "ash/shell_window_ids.h"
12 #include "ash/wm/overview/window_selector.h" 13 #include "ash/wm/overview/window_selector.h"
13 #include "ash/wm/overview/window_selector_item.h" 14 #include "ash/wm/overview/window_selector_item.h"
15 #include "base/metrics/histogram.h"
14 #include "third_party/skia/include/core/SkColor.h" 16 #include "third_party/skia/include/core/SkColor.h"
15 #include "ui/aura/root_window.h" 17 #include "ui/aura/root_window.h"
16 #include "ui/aura/window.h" 18 #include "ui/aura/window.h"
17 #include "ui/compositor/scoped_layer_animation_settings.h" 19 #include "ui/compositor/scoped_layer_animation_settings.h"
18 #include "ui/events/event.h" 20 #include "ui/events/event.h"
19 #include "ui/views/widget/widget.h" 21 #include "ui/views/widget/widget.h"
20 22
21 namespace ash { 23 namespace ash {
22 24
23 namespace { 25 namespace {
(...skipping 20 matching lines...) Expand all
44 const aura::Window* target; 46 const aura::Window* target;
45 }; 47 };
46 48
47 } // namespace 49 } // namespace
48 50
49 WindowOverview::WindowOverview(WindowSelector* window_selector, 51 WindowOverview::WindowOverview(WindowSelector* window_selector,
50 WindowSelectorItemList* windows, 52 WindowSelectorItemList* windows,
51 aura::RootWindow* single_root_window) 53 aura::RootWindow* single_root_window)
52 : window_selector_(window_selector), 54 : window_selector_(window_selector),
53 windows_(windows), 55 windows_(windows),
54 single_root_window_(single_root_window) { 56 single_root_window_(single_root_window),
57 overview_start_time_(base::Time::Now()) {
55 PositionWindows(); 58 PositionWindows();
56 ash::Shell::GetInstance()->AddPreTargetHandler(this); 59 ash::Shell::GetInstance()->AddPreTargetHandler(this);
60 Shell* shell = Shell::GetInstance();
61 shell->delegate()->RecordUserMetricsAction(UMA_WINDOW_OVERVIEW);
57 } 62 }
58 63
59 WindowOverview::~WindowOverview() { 64 WindowOverview::~WindowOverview() {
60 ash::Shell::GetInstance()->RemovePreTargetHandler(this); 65 ash::Shell::GetInstance()->RemovePreTargetHandler(this);
66 UMA_HISTOGRAM_MEDIUM_TIMES(
67 "Ash.WindowSelector.TimeInOverview",
68 base::Time::Now() - overview_start_time_);
61 } 69 }
62 70
63 void WindowOverview::SetSelection(size_t index) { 71 void WindowOverview::SetSelection(size_t index) {
64 DCHECK_LT(index, windows_->size()); 72 DCHECK_LT(index, windows_->size());
65 gfx::Rect target_bounds = (*windows_)[index]->bounds(); 73 gfx::Rect target_bounds = (*windows_)[index]->bounds();
66 target_bounds.Inset(-kWindowOverviewSelectionPadding, 74 target_bounds.Inset(-kWindowOverviewSelectionPadding,
67 -kWindowOverviewSelectionPadding); 75 -kWindowOverviewSelectionPadding);
68 76
69 if (selection_widget_) { 77 if (selection_widget_) {
70 // If the selection widget is already active, animate to the new bounds. 78 // If the selection widget is already active, animate to the new bounds.
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 views::Background::CreateSolidBackground(kWindowOverviewSelectionColor)); 245 views::Background::CreateSolidBackground(kWindowOverviewSelectionColor));
238 selection_widget_->SetContentsView(content_view); 246 selection_widget_->SetContentsView(content_view);
239 selection_widget_->GetNativeWindow()->parent()->StackChildAtBottom( 247 selection_widget_->GetNativeWindow()->parent()->StackChildAtBottom(
240 selection_widget_->GetNativeWindow()); 248 selection_widget_->GetNativeWindow());
241 selection_widget_->Show(); 249 selection_widget_->Show();
242 selection_widget_->GetNativeWindow()->layer()->SetOpacity( 250 selection_widget_->GetNativeWindow()->layer()->SetOpacity(
243 kWindowOverviewSelectionOpacity); 251 kWindowOverviewSelectionOpacity);
244 } 252 }
245 253
246 } // namespace ash 254 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/overview/window_overview.h ('k') | ash/wm/overview/window_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698