OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_ | 5 #ifndef CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_ |
6 #define CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_ | 6 #define CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/task.h" | 9 #include "base/memory/weak_ptr.h" |
10 | 10 |
11 class TabStripModel; | 11 class TabStripModel; |
12 | 12 |
13 // Helper class to perform "spring-loaded" tab transitions. Manages | 13 // Helper class to perform "spring-loaded" tab transitions. Manages |
14 // the lifecycle of delayed tab transition tasks. | 14 // the lifecycle of delayed tab transition tasks. |
15 class HoverTabSelector { | 15 class HoverTabSelector { |
16 public: | 16 public: |
17 explicit HoverTabSelector(TabStripModel* tab_strip_model); | 17 explicit HoverTabSelector(TabStripModel* tab_strip_model); |
18 ~HoverTabSelector(); | 18 ~HoverTabSelector(); |
19 | 19 |
(...skipping 10 matching lines...) Expand all Loading... |
30 // Performs the tab transition. | 30 // Performs the tab transition. |
31 void PerformTabTransition(); | 31 void PerformTabTransition(); |
32 | 32 |
33 // Model of the tab strip on which this class operates. | 33 // Model of the tab strip on which this class operates. |
34 TabStripModel* tab_strip_model_; | 34 TabStripModel* tab_strip_model_; |
35 | 35 |
36 // The model index of the tab to transition to. | 36 // The model index of the tab to transition to. |
37 int tab_transition_tab_index_; | 37 int tab_transition_tab_index_; |
38 | 38 |
39 // Factory for creating tab transition tasks. | 39 // Factory for creating tab transition tasks. |
40 ScopedRunnableMethodFactory<HoverTabSelector> task_factory_; | 40 base::WeakPtrFactory<HoverTabSelector> weak_factory_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(HoverTabSelector); | 42 DISALLOW_COPY_AND_ASSIGN(HoverTabSelector); |
43 }; | 43 }; |
44 | 44 |
45 #endif // CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_ | 45 #endif // CHROME_BROWSER_UI_TABS_HOVER_TAB_SELECTOR_H_ |
46 | 46 |
OLD | NEW |