OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/tabs/tab_strip_model_observer.h" | 5 #include "chrome/browser/tabs/tab_strip_model_observer.h" |
6 | 6 |
| 7 #include "chrome/browser/tabs/tab_strip_model.h" |
| 8 |
7 void TabStripModelObserver::TabInsertedAt(TabContentsWrapper* contents, | 9 void TabStripModelObserver::TabInsertedAt(TabContentsWrapper* contents, |
8 int index, | 10 int index, |
9 bool foreground) { | 11 bool foreground) { |
10 } | 12 } |
11 | 13 |
12 void TabStripModelObserver::TabClosingAt(TabStripModel* tab_strip_model, | 14 void TabStripModelObserver::TabClosingAt(TabStripModel* tab_strip_model, |
13 TabContentsWrapper* contents, | 15 TabContentsWrapper* contents, |
14 int index) { | 16 int index) { |
15 } | 17 } |
16 | 18 |
17 void TabStripModelObserver::TabDetachedAt(TabContentsWrapper* contents, | 19 void TabStripModelObserver::TabDetachedAt(TabContentsWrapper* contents, |
18 int index) { | 20 int index) { |
19 } | 21 } |
20 | 22 |
21 void TabStripModelObserver::TabDeselected(TabContentsWrapper* contents) { | 23 void TabStripModelObserver::TabDeselected(TabContentsWrapper* contents) { |
22 } | 24 } |
23 | 25 |
| 26 void TabStripModelObserver::TabSelectionChanged( |
| 27 TabStripModel* model, |
| 28 TabContentsWrapper* old_contents, |
| 29 bool user_gesture) { |
| 30 TabContentsWrapper* new_contents = model->GetSelectedTabContents(); |
| 31 if (new_contents != old_contents) { |
| 32 TabSelectedAt(old_contents, new_contents, model->selected_index(), |
| 33 user_gesture); |
| 34 } |
| 35 } |
| 36 |
24 void TabStripModelObserver::TabSelectedAt(TabContentsWrapper* old_contents, | 37 void TabStripModelObserver::TabSelectedAt(TabContentsWrapper* old_contents, |
25 TabContentsWrapper* new_contents, | 38 TabContentsWrapper* new_contents, |
26 int index, | 39 int index, |
27 bool user_gesture) { | 40 bool user_gesture) { |
28 } | 41 } |
29 | 42 |
30 void TabStripModelObserver::TabMoved(TabContentsWrapper* contents, | 43 void TabStripModelObserver::TabMoved(TabContentsWrapper* contents, |
31 int from_index, | 44 int from_index, |
32 int to_index) { | 45 int to_index) { |
33 } | 46 } |
(...skipping 17 matching lines...) Expand all Loading... |
51 int index) { | 64 int index) { |
52 } | 65 } |
53 | 66 |
54 void TabStripModelObserver::TabBlockedStateChanged(TabContentsWrapper* contents, | 67 void TabStripModelObserver::TabBlockedStateChanged(TabContentsWrapper* contents, |
55 int index) { | 68 int index) { |
56 } | 69 } |
57 | 70 |
58 void TabStripModelObserver::TabStripEmpty() {} | 71 void TabStripModelObserver::TabStripEmpty() {} |
59 | 72 |
60 void TabStripModelObserver::TabStripModelDeleted() {} | 73 void TabStripModelObserver::TabStripModelDeleted() {} |
OLD | NEW |