Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: chrome/browser/tabs/tab_strip_model.h

Issue 7033048: Multi-tab: Adding new Notification when tab selection changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renaming BaseTabStrip::SelectTabAt, updating callers Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
516 TabContentsWrapper* GetContentsAt(int index) const; 516 TabContentsWrapper* GetContentsAt(int index) const;
517 517
518 // If the TabContentsWrapper at |to_index| differs from |old_contents| 518 // If the TabContentsWrapper at |to_index| differs from |old_contents|
519 // notifies observers. 519 // notifies observers.
520 void NotifyTabSelectedIfChanged(TabContentsWrapper* old_contents, 520 void NotifyTabSelectedIfChanged(TabContentsWrapper* old_contents,
521 int to_index, 521 int to_index,
522 bool user_gesture); 522 bool user_gesture);
523 523
524 // Notifies the observers the active tab changed. |old_active_index| gives 524 // Notifies the observers the active tab changed. |old_active_index| gives
525 // the old active index. 525 // the old active index.
526 void NotifyActiveTabChanged(int old_active_index); 526 void NotifyActiveTabChanged(int old_active_index, bool user_gesture);
527
528 // Notifies the observers that the tab selection has changed. |model| is a
529 // snapshot of |selection_model_|_ before the change.
530 void NotifySelectionChanged(const TabStripSelectionModel& model);
531
532 // Notifies the observers only if the active tab or the tab selection has
533 // changed, by calling NotifyActiveTabChanged and/or NotifySelectionChanged.
534 // |model| is a snapshot of |selection_model_|_ before the change.
535 void NotifyIfActiveOrSelectionChanged(const TabStripSelectionModel& model,
536 bool user_gesture);
527 537
528 // Returns the number of New Tab tabs in the TabStripModel. 538 // Returns the number of New Tab tabs in the TabStripModel.
529 int GetNewTabCount() const; 539 int GetNewTabCount() const;
530 540
531 // Selects either the next tab (|foward| is true), or the previous tab 541 // Selects either the next tab (|foward| is true), or the previous tab
532 // (|forward| is false). 542 // (|forward| is false).
533 void SelectRelativeTab(bool forward); 543 void SelectRelativeTab(bool forward);
534 544
535 // Does the work of MoveTabContentsAt. This has no checks to make sure the 545 // Does the work of MoveTabContentsAt. This has no checks to make sure the
536 // position is valid, those are done in MoveTabContentsAt. 546 // position is valid, those are done in MoveTabContentsAt.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
634 644
635 // A scoped container for notification registries. 645 // A scoped container for notification registries.
636 NotificationRegistrar registrar_; 646 NotificationRegistrar registrar_;
637 647
638 TabStripSelectionModel selection_model_; 648 TabStripSelectionModel selection_model_;
639 649
640 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); 650 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel);
641 }; 651 };
642 652
643 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ 653 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698