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

Side by Side Diff: ash/common/wm/overview/window_selector.cc

Issue 2096853002: [ash-md] Adds UMA depth count for Overview mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
tdanderson 2016/06/24 00:17:50 Please include a CL description (and cite the hist
varkha 2016/06/24 16:31:39 Done.
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/common/wm/overview/window_selector.h" 5 #include "ash/common/wm/overview/window_selector.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
11 #include <vector> 11 #include <vector>
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 // If the grid which became empty was the one with the selected window, we 448 // If the grid which became empty was the one with the selected window, we
449 // need to select a window on the newly selected grid. 449 // need to select a window on the newly selected grid.
450 if (selected_grid_index_ == index - 1) 450 if (selected_grid_index_ == index - 1)
451 Move(LEFT, true); 451 Move(LEFT, true);
452 } 452 }
453 if (grid_list_.empty()) 453 if (grid_list_.empty())
454 CancelSelection(); 454 CancelSelection();
455 } 455 }
456 456
457 void WindowSelector::SelectWindow(WmWindow* window) { 457 void WindowSelector::SelectWindow(WmWindow* window) {
458 // Record UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED if the user is selecting 458 // Record UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED if the user is selecting
tdanderson 2016/06/24 00:17:50 Move this comment above line 464 or 465.
varkha 2016/06/24 16:31:39 Done.
459 // a window other than the window that was active prior to entering overview 459 // a window other than the window that was active prior to entering overview
460 // mode (i.e., the window at the front of the MRU list). 460 // mode (i.e., the window at the front of the MRU list).
461 std::vector<WmWindow*> window_list = 461 std::vector<WmWindow*> window_list =
462 WmShell::Get()->GetMruWindowTracker()->BuildMruWindowList(); 462 WmShell::Get()->GetMruWindowTracker()->BuildMruWindowList();
463 if (!window_list.empty() && window_list[0] != window) { 463 if (!window_list.empty()) {
464 WmShell::Get()->RecordUserMetricsAction( 464 if (window_list[0] != window) {
465 UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED); 465 WmShell::Get()->RecordUserMetricsAction(
466 UMA_WINDOW_OVERVIEW_ACTIVE_WINDOW_CHANGED);
467 }
468 const auto it = std::find(window_list.begin(), window_list.end(), window);
469 if (it != window_list.end()) {
470 UMA_HISTOGRAM_COUNTS_100("Ash.WindowSelector.SelectionDepth",
471 it - window_list.begin());
472 }
466 } 473 }
467 474
468 window->GetWindowState()->Activate(); 475 window->GetWindowState()->Activate();
469 } 476 }
470 477
471 bool WindowSelector::HandleKeyEvent(views::Textfield* sender, 478 bool WindowSelector::HandleKeyEvent(views::Textfield* sender,
472 const ui::KeyEvent& key_event) { 479 const ui::KeyEvent& key_event) {
473 if (key_event.type() != ui::ET_KEY_PRESSED) 480 if (key_event.type() != ui::ET_KEY_PRESSED)
474 return false; 481 return false;
475 482
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 for (size_t i = 0; i <= grid_list_.size() && 686 for (size_t i = 0; i <= grid_list_.size() &&
680 grid_list_[selected_grid_index_]->Move(direction, animate); 687 grid_list_[selected_grid_index_]->Move(direction, animate);
681 i++) { 688 i++) {
682 selected_grid_index_ = 689 selected_grid_index_ =
683 (selected_grid_index_ + display_direction + grid_list_.size()) % 690 (selected_grid_index_ + display_direction + grid_list_.size()) %
684 grid_list_.size(); 691 grid_list_.size();
685 } 692 }
686 } 693 }
687 694
688 } // namespace ash 695 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698