Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_TABS_TAB_STRIP_MODEL_H_ | 5 #ifndef CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ |
| 6 #define CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ | 6 #define CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 30 matching lines...) Expand all Loading... | |
| 41 // | 41 // |
| 42 //////////////////////////////////////////////////////////////////////////////// | 42 //////////////////////////////////////////////////////////////////////////////// |
| 43 class TabStripModelObserver { | 43 class TabStripModelObserver { |
| 44 public: | 44 public: |
| 45 // A new TabContents was inserted into the TabStripModel at the specified | 45 // A new TabContents was inserted into the TabStripModel at the specified |
| 46 // index. |foreground| is whether or not it was opened in the foreground | 46 // index. |foreground| is whether or not it was opened in the foreground |
| 47 // (selected). | 47 // (selected). |
| 48 virtual void TabInsertedAt(TabContents* contents, | 48 virtual void TabInsertedAt(TabContents* contents, |
| 49 int index, | 49 int index, |
| 50 bool foreground) { } | 50 bool foreground) { } |
| 51 | |
| 51 // The specified TabContents at |index| is being closed (and eventually | 52 // The specified TabContents at |index| is being closed (and eventually |
| 52 // destroyed). | 53 // destroyed). |
| 53 virtual void TabClosingAt(TabContents* contents, int index) { } | 54 virtual void TabClosingAt(TabContents* contents, int index) { } |
| 55 | |
| 54 // The specified TabContents at |index| is being detached, perhaps to be | 56 // The specified TabContents at |index| is being detached, perhaps to be |
| 55 // inserted in another TabStripModel. The implementer should take whatever | 57 // inserted in another TabStripModel. The implementer should take whatever |
| 56 // action is necessary to deal with the TabContents no longer being present. | 58 // action is necessary to deal with the TabContents no longer being present. |
| 57 virtual void TabDetachedAt(TabContents* contents, int index) { } | 59 virtual void TabDetachedAt(TabContents* contents, int index) { } |
| 60 | |
| 58 // The selected TabContents changed from |old_contents| to |new_contents| at | 61 // The selected TabContents changed from |old_contents| to |new_contents| at |
| 59 // |index|. |user_gesture| specifies whether or not this was done by a user | 62 // |index|. |user_gesture| specifies whether or not this was done by a user |
| 60 // input event (e.g. clicking on a tab, keystroke) or as a side-effect of | 63 // input event (e.g. clicking on a tab, keystroke) or as a side-effect of |
| 61 // some other function. | 64 // some other function. |
| 62 virtual void TabSelectedAt(TabContents* old_contents, | 65 virtual void TabSelectedAt(TabContents* old_contents, |
| 63 TabContents* new_contents, | 66 TabContents* new_contents, |
| 64 int index, | 67 int index, |
| 65 bool user_gesture) { } | 68 bool user_gesture) { } |
| 69 | |
| 66 // The specified TabContents at |from_index| was moved to |to_index|. | 70 // The specified TabContents at |from_index| was moved to |to_index|. |
| 67 virtual void TabMoved(TabContents* contents, | 71 virtual void TabMoved(TabContents* contents, |
| 68 int from_index, | 72 int from_index, |
| 69 int to_index) { } | 73 int to_index) { } |
| 74 | |
| 70 // The specified TabContents at |index| changed in some way. |contents| may | 75 // The specified TabContents at |index| changed in some way. |contents| may |
| 71 // be an entirely different object and the old value is no longer available | 76 // be an entirely different object and the old value is no longer available |
| 72 // by the time this message is delivered. | 77 // by the time this message is delivered. |
| 78 // | |
| 79 // If only the loading state was updated, the loading_only flag should be | |
| 80 // specified. If other things change, set this flag to false to update | |
|
pink (ping after 24hrs)
2009/04/07 13:29:27
This seems a little backwards. The client implemen
brettw
2009/04/07 16:59:31
I think that comments should generally be written
| |
| 81 // everything. This allows us to start/stop throbbing without updating the | |
| 82 // title (which may be an ugly URL if the real title hasn't come in yet). | |
| 73 virtual void TabChangedAt(TabContents* contents, int index, | 83 virtual void TabChangedAt(TabContents* contents, int index, |
| 74 bool loading_only) { } | 84 bool loading_only) { } |
| 85 | |
| 75 // The TabStripModel now no longer has any "significant" (user created or | 86 // The TabStripModel now no longer has any "significant" (user created or |
| 76 // user manipulated) tabs. The implementer may use this as a trigger to try | 87 // user manipulated) tabs. The implementer may use this as a trigger to try |
| 77 // and close the window containing the TabStripModel, for example... | 88 // and close the window containing the TabStripModel, for example... |
| 78 virtual void TabStripEmpty() { } | 89 virtual void TabStripEmpty() { } |
| 79 }; | 90 }; |
| 80 | 91 |
| 81 /////////////////////////////////////////////////////////////////////////////// | 92 /////////////////////////////////////////////////////////////////////////////// |
| 82 // | 93 // |
| 83 // TabStripModelDelegate | 94 // TabStripModelDelegate |
| 84 // | 95 // |
| (...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 542 TabStripModelOrderController* order_controller_; | 553 TabStripModelOrderController* order_controller_; |
| 543 | 554 |
| 544 // Our observers. | 555 // Our observers. |
| 545 typedef ObserverList<TabStripModelObserver> TabStripModelObservers; | 556 typedef ObserverList<TabStripModelObserver> TabStripModelObservers; |
| 546 TabStripModelObservers observers_; | 557 TabStripModelObservers observers_; |
| 547 | 558 |
| 548 DISALLOW_COPY_AND_ASSIGN(TabStripModel); | 559 DISALLOW_COPY_AND_ASSIGN(TabStripModel); |
| 549 }; | 560 }; |
| 550 | 561 |
| 551 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ | 562 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ |
| OLD | NEW |