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

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: Fixing existing unit tests, adding new unit test for multiple selection. 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 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 // 507 //
508 // The boolean parameter create_historical_tab controls whether to 508 // The boolean parameter create_historical_tab controls whether to
509 // record these tabs and their history for reopening recently closed 509 // record these tabs and their history for reopening recently closed
510 // tabs. 510 // tabs.
511 void InternalCloseTab(TabContentsWrapper* contents, 511 void InternalCloseTab(TabContentsWrapper* contents,
512 int index, 512 int index,
513 bool create_historical_tabs); 513 bool create_historical_tabs);
514 514
515 TabContentsWrapper* GetContentsAt(int index) const; 515 TabContentsWrapper* GetContentsAt(int index) const;
516 516
517 // If the TabContentsWrapper at |to_index| differs from |old_contents| 517 // Notifies the observers if the active tab or the tab selection has changed.
518 // notifies observers. 518 // If |old_contents| is non-null a TabDeactivated notification is sent right
519 void NotifyTabSelectedIfChanged(TabContentsWrapper* old_contents, 519 // before sending ActiveTabChanged notification. |old_model| is a snapshot of
520 int to_index, 520 // |selection_model_| before the change.
521 bool user_gesture); 521 // Note: This function might end up sending 0 to 3 notifications in the
522 522 // following order: TabDeactivated, ActiveTabChanged, TabSelectionChanged.
523 // Notifies the observers the active tab changed. |old_active_index| gives 523 void NotifyIfActiveOrSelectionChanged(
524 // the old active index. 524 TabContentsWrapper* old_contents,
525 void NotifyActiveTabChanged(int old_active_index); 525 bool user_gesture,
526 const TabStripSelectionModel& old_model);
526 527
527 // Returns the number of New Tab tabs in the TabStripModel. 528 // Returns the number of New Tab tabs in the TabStripModel.
528 int GetNewTabCount() const; 529 int GetNewTabCount() const;
529 530
530 // Selects either the next tab (|foward| is true), or the previous tab 531 // Selects either the next tab (|foward| is true), or the previous tab
531 // (|forward| is false). 532 // (|forward| is false).
532 void SelectRelativeTab(bool forward); 533 void SelectRelativeTab(bool forward);
533 534
534 // Does the work of MoveTabContentsAt. This has no checks to make sure the 535 // Does the work of MoveTabContentsAt. This has no checks to make sure the
535 // position is valid, those are done in MoveTabContentsAt. 536 // position is valid, those are done in MoveTabContentsAt.
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 634
634 // A scoped container for notification registries. 635 // A scoped container for notification registries.
635 NotificationRegistrar registrar_; 636 NotificationRegistrar registrar_;
636 637
637 TabStripSelectionModel selection_model_; 638 TabStripSelectionModel selection_model_;
638 639
639 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel); 640 DISALLOW_IMPLICIT_CONSTRUCTORS(TabStripModel);
640 }; 641 };
641 642
642 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_ 643 #endif // CHROME_BROWSER_TABS_TAB_STRIP_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698