OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tabs/hover_tab_selector.h" | 5 #include "chrome/browser/ui/tabs/hover_tab_selector.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
13 | 13 |
14 HoverTabSelector::HoverTabSelector( | 14 HoverTabSelector::HoverTabSelector( |
15 TabStripModel* tab_strip_model) | 15 TabStripModel* tab_strip_model) |
16 : tab_strip_model_(tab_strip_model), | 16 : tab_strip_model_(tab_strip_model), |
17 tab_transition_tab_index_(-1), | 17 tab_transition_tab_index_(-1), |
18 weak_factory_(this) { | 18 weak_factory_(this) { |
19 DCHECK(tab_strip_model_); | 19 DCHECK(tab_strip_model_); |
20 } | 20 } |
21 | 21 |
(...skipping 25 matching lines...) Expand all Loading... |
47 void HoverTabSelector::CancelTabTransition() { | 47 void HoverTabSelector::CancelTabTransition() { |
48 weak_factory_.InvalidateWeakPtrs(); | 48 weak_factory_.InvalidateWeakPtrs(); |
49 } | 49 } |
50 | 50 |
51 void HoverTabSelector::PerformTabTransition() { | 51 void HoverTabSelector::PerformTabTransition() { |
52 DCHECK(tab_transition_tab_index_ >= 0 && | 52 DCHECK(tab_transition_tab_index_ >= 0 && |
53 tab_transition_tab_index_ < tab_strip_model_->count()); | 53 tab_transition_tab_index_ < tab_strip_model_->count()); |
54 tab_strip_model_->ActivateTabAt(tab_transition_tab_index_, true); | 54 tab_strip_model_->ActivateTabAt(tab_transition_tab_index_, true); |
55 } | 55 } |
56 | 56 |
OLD | NEW |