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 #ifndef CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ |
6 #define CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 | 287 |
288 // Returns the index of the specified TabContents given its raw | 288 // Returns the index of the specified TabContents given its raw |
289 // WebContents, or TabStripModel::kNoTab if the WebContents is not in this | 289 // WebContents, or TabStripModel::kNoTab if the WebContents is not in this |
290 // TabStripModel. Note: This is only needed in rare cases where the | 290 // TabStripModel. Note: This is only needed in rare cases where the |
291 // TabContents is not already present (such as implementing | 291 // TabContents is not already present (such as implementing |
292 // WebContentsDelegate methods, which don't know about TabContents). Returns | 292 // WebContentsDelegate methods, which don't know about TabContents). Returns |
293 // NULL if |contents| is not associated with any TabContents in the | 293 // NULL if |contents| is not associated with any TabContents in the |
294 // model. | 294 // model. |
295 int GetIndexOfWebContents(const content::WebContents* contents) const; | 295 int GetIndexOfWebContents(const content::WebContents* contents) const; |
296 | 296 |
297 // Returns the index of the specified NavigationController, or kNoTab if it is | |
298 // not in this TabStripModel. | |
299 int GetIndexOfController( | |
300 const content::NavigationController* controller) const; | |
301 | |
302 // Notify any observers that the TabContents at the specified index has | 297 // Notify any observers that the TabContents at the specified index has |
303 // changed in some way. See TabChangeType for details of |change_type|. | 298 // changed in some way. See TabChangeType for details of |change_type|. |
304 void UpdateTabContentsStateAt( | 299 void UpdateTabContentsStateAt( |
305 int index, | 300 int index, |
306 TabStripModelObserver::TabChangeType change_type); | 301 TabStripModelObserver::TabChangeType change_type); |
307 | 302 |
308 // Make sure there is an auto-generated New Tab tab in the TabStripModel. | 303 // Make sure there is an auto-generated New Tab tab in the TabStripModel. |
309 // If |force_create| is true, the New Tab will be created even if the | 304 // If |force_create| is true, the New Tab will be created even if the |
310 // preference is set to false (used by startup). | 305 // preference is set to false (used by startup). |
311 void EnsureNewTabVisible(bool force_create); | 306 void EnsureNewTabVisible(bool force_create); |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 | 698 |
704 // A scoped container for notification registries. | 699 // A scoped container for notification registries. |
705 content::NotificationRegistrar registrar_; | 700 content::NotificationRegistrar registrar_; |
706 | 701 |
707 TabStripSelectionModel selection_model_; | 702 TabStripSelectionModel selection_model_; |
708 | 703 |
709 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); | 704 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); |
710 }; | 705 }; |
711 | 706 |
712 #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ | 707 #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ |
OLD | NEW |