| 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/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 virtual void TabSelectedAt(TabContents* old_contents, | 62 virtual void TabSelectedAt(TabContents* old_contents, |
| 63 TabContents* new_contents, | 63 TabContents* new_contents, |
| 64 int index, | 64 int index, |
| 65 bool user_gesture) { } | 65 bool user_gesture) { } |
| 66 // The specified TabContents at |from_index| was moved to |to_index|. | 66 // The specified TabContents at |from_index| was moved to |to_index|. |
| 67 virtual void TabMoved(TabContents* contents, | 67 virtual void TabMoved(TabContents* contents, |
| 68 int from_index, | 68 int from_index, |
| 69 int to_index) { } | 69 int to_index) { } |
| 70 // The specified TabContents at |index| changed in some way. | 70 // The specified TabContents at |index| changed in some way. |
| 71 virtual void TabChangedAt(TabContents* contents, int index) { } | 71 virtual void TabChangedAt(TabContents* contents, int index) { } |
| 72 // Loading progress representations for tabs should be validated/updated. | |
| 73 // TODO(beng): this wiring is cracktarded. consider revising. The loading | |
| 74 // animation timer should live in BrowserView2, and from there | |
| 75 // notify both the tabstrip and the window icon. | |
| 76 // clean this up once XPFrame and VistaFrame have retired. | |
| 77 virtual void TabValidateAnimations() { } | |
| 78 // The TabStripModel now no longer has any "significant" (user created or | 72 // The TabStripModel now no longer has any "significant" (user created or |
| 79 // user manipulated) tabs. The implementer may use this as a trigger to try | 73 // user manipulated) tabs. The implementer may use this as a trigger to try |
| 80 // and close the window containing the TabStripModel, for example... | 74 // and close the window containing the TabStripModel, for example... |
| 81 virtual void TabStripEmpty() { } | 75 virtual void TabStripEmpty() { } |
| 82 }; | 76 }; |
| 83 | 77 |
| 84 /////////////////////////////////////////////////////////////////////////////// | 78 /////////////////////////////////////////////////////////////////////////////// |
| 85 // | 79 // |
| 86 // TabStripModelDelegate | 80 // TabStripModelDelegate |
| 87 // | 81 // |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 bool defer_load, | 118 bool defer_load, |
| 125 SiteInstance* instance) const = 0; | 119 SiteInstance* instance) const = 0; |
| 126 | 120 |
| 127 // Return whether some contents can be duplicated. | 121 // Return whether some contents can be duplicated. |
| 128 virtual bool CanDuplicateContentsAt(int index) = 0; | 122 virtual bool CanDuplicateContentsAt(int index) = 0; |
| 129 | 123 |
| 130 // Duplicate the contents at the provided index and places it into its own | 124 // Duplicate the contents at the provided index and places it into its own |
| 131 // window. | 125 // window. |
| 132 virtual void DuplicateContentsAt(int index) = 0; | 126 virtual void DuplicateContentsAt(int index) = 0; |
| 133 | 127 |
| 134 // Called every time the the throbber needs to be updated. We have this to | |
| 135 // give the browser/frame a chance to implement some loading animation. This | |
| 136 // is used by simple web application frames. | |
| 137 virtual void ValidateLoadingAnimations() = 0; | |
| 138 | |
| 139 // Called when a drag session has completed and the frame that initiated the | 128 // Called when a drag session has completed and the frame that initiated the |
| 140 // the session should be closed. | 129 // the session should be closed. |
| 141 virtual void CloseFrameAfterDragSession() = 0; | 130 virtual void CloseFrameAfterDragSession() = 0; |
| 142 }; | 131 }; |
| 143 | 132 |
| 144 //////////////////////////////////////////////////////////////////////////////// | 133 //////////////////////////////////////////////////////////////////////////////// |
| 145 // | 134 // |
| 146 // TabStripModel | 135 // TabStripModel |
| 147 // | 136 // |
| 148 // A model & low level controller of a Browser Window tabstrip. Holds a vector | 137 // A model & low level controller of a Browser Window tabstrip. Holds a vector |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 int GetIndexOfTabContents(const TabContents* contents) const; | 262 int GetIndexOfTabContents(const TabContents* contents) const; |
| 274 | 263 |
| 275 // Returns the index of the specified NavigationController, or -1 if it is | 264 // Returns the index of the specified NavigationController, or -1 if it is |
| 276 // not in this TabStripModel. | 265 // not in this TabStripModel. |
| 277 int GetIndexOfController(const NavigationController* controller) const; | 266 int GetIndexOfController(const NavigationController* controller) const; |
| 278 | 267 |
| 279 // Notify any observers that the TabContents at the specified index has | 268 // Notify any observers that the TabContents at the specified index has |
| 280 // changed in some way. | 269 // changed in some way. |
| 281 void UpdateTabContentsStateAt(int index); | 270 void UpdateTabContentsStateAt(int index); |
| 282 | 271 |
| 283 // Notify any observers that Loading progress for TabContents should be | |
| 284 // validated. | |
| 285 // TODO(beng): (Cleanup) This should definitely be moved to the View. | |
| 286 void UpdateTabContentsLoadingAnimations(); | |
| 287 | |
| 288 // Make sure there is an auto-generated New Tab tab in the TabStripModel. | 272 // Make sure there is an auto-generated New Tab tab in the TabStripModel. |
| 289 // If |force_create| is true, the New Tab will be created even if the | 273 // If |force_create| is true, the New Tab will be created even if the |
| 290 // preference is set to false (used by startup). | 274 // preference is set to false (used by startup). |
| 291 void EnsureNewTabVisible(bool force_create); | 275 void EnsureNewTabVisible(bool force_create); |
| 292 | 276 |
| 293 // Close all tabs at once. Code can use closing_all() above to defer | 277 // Close all tabs at once. Code can use closing_all() above to defer |
| 294 // operations that might otherwise by invoked by the flurry of detach/select | 278 // operations that might otherwise by invoked by the flurry of detach/select |
| 295 // notifications this method causes. | 279 // notifications this method causes. |
| 296 void CloseAllTabs(); | 280 void CloseAllTabs(); |
| 297 | 281 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 | 511 |
| 528 // Our observers. | 512 // Our observers. |
| 529 typedef ObserverList<TabStripModelObserver> TabStripModelObservers; | 513 typedef ObserverList<TabStripModelObserver> TabStripModelObservers; |
| 530 TabStripModelObservers observers_; | 514 TabStripModelObservers observers_; |
| 531 | 515 |
| 532 DISALLOW_EVIL_CONSTRUCTORS(TabStripModel); | 516 DISALLOW_EVIL_CONSTRUCTORS(TabStripModel); |
| 533 }; | 517 }; |
| 534 | 518 |
| 535 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H__ | 519 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H__ |
| 536 | 520 |
| OLD | NEW |