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 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
12 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 12 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
13 #include "content/public/common/page_transition_types.h" | |
14 #include "ui/base/models/list_selection_model.h" | 13 #include "ui/base/models/list_selection_model.h" |
| 14 #include "ui/base/page_transition_types.h" |
15 | 15 |
16 class Profile; | 16 class Profile; |
17 class TabStripModelDelegate; | 17 class TabStripModelDelegate; |
18 class TabStripModelOrderController; | 18 class TabStripModelOrderController; |
19 | 19 |
20 namespace content { | 20 namespace content { |
21 class WebContents; | 21 class WebContents; |
22 } | 22 } |
23 | 23 |
24 //////////////////////////////////////////////////////////////////////////////// | 24 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 // Returns the index of the last WebContents in the model opened by the | 287 // Returns the index of the last WebContents in the model opened by the |
288 // specified opener, starting at |start_index|. | 288 // specified opener, starting at |start_index|. |
289 int GetIndexOfLastWebContentsOpenedBy(const content::WebContents* opener, | 289 int GetIndexOfLastWebContentsOpenedBy(const content::WebContents* opener, |
290 int start_index) const; | 290 int start_index) const; |
291 | 291 |
292 // To be called when a navigation is about to occur in the specified | 292 // To be called when a navigation is about to occur in the specified |
293 // WebContents. Depending on the tab, and the transition type of the | 293 // WebContents. Depending on the tab, and the transition type of the |
294 // navigation, the TabStripModel may adjust its selection and grouping | 294 // navigation, the TabStripModel may adjust its selection and grouping |
295 // behavior. | 295 // behavior. |
296 void TabNavigating(content::WebContents* contents, | 296 void TabNavigating(content::WebContents* contents, |
297 content::PageTransition transition); | 297 ui::PageTransition transition); |
298 | 298 |
299 // Forget all Opener relationships that are stored (but _not_ group | 299 // Forget all Opener relationships that are stored (but _not_ group |
300 // relationships!) This is to reduce unpredictable tab switching behavior | 300 // relationships!) This is to reduce unpredictable tab switching behavior |
301 // in complex session states. The exact circumstances under which this method | 301 // in complex session states. The exact circumstances under which this method |
302 // is called are left up to the implementation of the selected | 302 // is called are left up to the implementation of the selected |
303 // TabStripModelOrderController. | 303 // TabStripModelOrderController. |
304 void ForgetAllOpeners(); | 304 void ForgetAllOpeners(); |
305 | 305 |
306 // Forgets the group affiliation of the specified WebContents. This | 306 // Forgets the group affiliation of the specified WebContents. This |
307 // should be called when a WebContents that is part of a logical group | 307 // should be called when a WebContents that is part of a logical group |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 | 375 |
376 // Command level API ///////////////////////////////////////////////////////// | 376 // Command level API ///////////////////////////////////////////////////////// |
377 | 377 |
378 // Adds a WebContents at the best position in the TabStripModel given | 378 // Adds a WebContents at the best position in the TabStripModel given |
379 // the specified insertion index, transition, etc. |add_types| is a bitmask of | 379 // the specified insertion index, transition, etc. |add_types| is a bitmask of |
380 // AddTabTypes; see it for details. This method ends up calling into | 380 // AddTabTypes; see it for details. This method ends up calling into |
381 // InsertWebContentsAt to do the actual insertion. Pass kNoTab for |index| to | 381 // InsertWebContentsAt to do the actual insertion. Pass kNoTab for |index| to |
382 // append the contents to the end of the tab strip. | 382 // append the contents to the end of the tab strip. |
383 void AddWebContents(content::WebContents* contents, | 383 void AddWebContents(content::WebContents* contents, |
384 int index, | 384 int index, |
385 content::PageTransition transition, | 385 ui::PageTransition transition, |
386 int add_types); | 386 int add_types); |
387 | 387 |
388 // Closes the selected tabs. | 388 // Closes the selected tabs. |
389 void CloseSelectedTabs(); | 389 void CloseSelectedTabs(); |
390 | 390 |
391 // Select adjacent tabs | 391 // Select adjacent tabs |
392 void SelectNextTab(); | 392 void SelectNextTab(); |
393 void SelectPreviousTab(); | 393 void SelectPreviousTab(); |
394 | 394 |
395 // Selects the last tab in the tab strip. | 395 // Selects the last tab in the tab strip. |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
575 | 575 |
576 // TODO(sky): remove this; used for debugging 291265. | 576 // TODO(sky): remove this; used for debugging 291265. |
577 bool in_notify_; | 577 bool in_notify_; |
578 | 578 |
579 base::WeakPtrFactory<TabStripModel> weak_factory_; | 579 base::WeakPtrFactory<TabStripModel> weak_factory_; |
580 | 580 |
581 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); | 581 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); |
582 }; | 582 }; |
583 | 583 |
584 #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ | 584 #endif // CHROME_BROWSER_UI_TABS_TAB_STRIP_MODEL_H_ |
OLD | NEW |