OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/ui/views/ash/tab_scrubber.h" | 5 #include "chrome/browser/ui/views/ash/tab_scrubber.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 BrowserView* browser_view = | 267 BrowserView* browser_view = |
268 BrowserView::GetBrowserViewForNativeWindow( | 268 BrowserView::GetBrowserViewForNativeWindow( |
269 browser_->window()->GetNativeWindow()); | 269 browser_->window()->GetNativeWindow()); |
270 TabStrip* tab_strip = browser_view->tabstrip(); | 270 TabStrip* tab_strip = browser_view->tabstrip(); |
271 if (activate && highlighted_tab_ != -1) { | 271 if (activate && highlighted_tab_ != -1) { |
272 Tab* tab = tab_strip->tab_at(highlighted_tab_); | 272 Tab* tab = tab_strip->tab_at(highlighted_tab_); |
273 tab->hover_controller()->HideImmediately(); | 273 tab->hover_controller()->HideImmediately(); |
274 int distance = | 274 int distance = |
275 std::abs( | 275 std::abs( |
276 highlighted_tab_ - browser_->tab_strip_model()->active_index()); | 276 highlighted_tab_ - browser_->tab_strip_model()->active_index()); |
277 UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.ScrubDistance", distance, 0, 20, 20); | 277 UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.ScrubDistance", distance, 0, 20, 21); |
278 browser_->tab_strip_model()->ActivateTabAt(highlighted_tab_, true); | 278 browser_->tab_strip_model()->ActivateTabAt(highlighted_tab_, true); |
279 } | 279 } |
280 tab_strip->RemoveObserver(this); | 280 tab_strip->RemoveObserver(this); |
281 } | 281 } |
282 swipe_x_ = -1; | 282 swipe_x_ = -1; |
283 swipe_y_ = -1; | 283 swipe_y_ = -1; |
284 scrubbing_ = false; | 284 scrubbing_ = false; |
285 highlighted_tab_ = -1; | 285 highlighted_tab_ = -1; |
286 } | 286 } |
OLD | NEW |