diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 21:03:54 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-15 21:03:54 +0000 |
commit | 3a3d4747769aec2954a2ca21de4812c5892994aa (patch) | |
tree | db112f2c73cc39e9d6088059eae1fc9d35b74920 /chrome/browser/tabs | |
parent | 2235b22b88260fde392b753b5d7bb7904e5efbc6 (diff) | |
download | chromium_src-3a3d4747769aec2954a2ca21de4812c5892994aa.zip chromium_src-3a3d4747769aec2954a2ca21de4812c5892994aa.tar.gz chromium_src-3a3d4747769aec2954a2ca21de4812c5892994aa.tar.bz2 |
Move implementation from header to source.
This is an effort to speed up compile and link time, and also minimizing the
size of the intermediary .o files on disk. For example, just moving the
constructor/destructor from the classes in chrome/browser/pref_member.{cc,h}
netted a 368k drop in total .o file size. In aggregate, this shrinks
libbrowser.a by 10 megabytes, and a few odd megabytes on most other chrome .a files.
A lot of this was done before I started harvesting what the most included
symbols were across all of chrome's code. Most of them are in webkit, but
there's plenty in base/ that are used everywhere to keep me busy for several
patches to come.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3012001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52528 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 60 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.h | 30 |
2 files changed, 74 insertions, 16 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index ef4677b..711e00e 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -46,6 +46,66 @@ bool ShouldForgetOpenersForTransition(PageTransition::Type transition) { } // namespace /////////////////////////////////////////////////////////////////////////////// +// TabStripModelObserver, public: + +void TabStripModelObserver::TabInsertedAt(TabContents* contents, + int index, + bool foreground) { +} + +void TabStripModelObserver::TabClosingAt(TabContents* contents, int index) { +} + +void TabStripModelObserver::TabDetachedAt(TabContents* contents, int index) { +} + +void TabStripModelObserver::TabDeselectedAt(TabContents* contents, int index) { +} + +void TabStripModelObserver::TabSelectedAt(TabContents* old_contents, + TabContents* new_contents, + int index, + bool user_gesture) { +} + +void TabStripModelObserver::TabMoved(TabContents* contents, + int from_index, + int to_index) { +} + +void TabStripModelObserver::TabChangedAt(TabContents* contents, int index, + TabChangeType change_type) { +} + +void TabStripModelObserver::TabReplacedAt(TabContents* old_contents, + TabContents* new_contents, + int index) { +} + +void TabStripModelObserver::TabPinnedStateChanged(TabContents* contents, + int index) { +} + +void TabStripModelObserver::TabMiniStateChanged(TabContents* contents, + int index) { +} + +void TabStripModelObserver::TabBlockedStateChanged(TabContents* contents, + int index) { +} + +void TabStripModelObserver::TabStripEmpty() {} + +void TabStripModelObserver::TabStripModelDeleted() {} + +/////////////////////////////////////////////////////////////////////////////// +// TabStripModelDelegate, public: + +bool TabStripModelDelegate::CanCloseTab() const { + return true; +} + +/////////////////////////////////////////////////////////////////////////////// // TabStripModel, public: TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile) diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index 4c1ad28..c00dbff 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -59,21 +59,21 @@ class TabStripModelObserver { // (selected). virtual void TabInsertedAt(TabContents* contents, int index, - bool foreground) {} + bool foreground); // The specified TabContents at |index| is being closed (and eventually // destroyed). - virtual void TabClosingAt(TabContents* contents, int index) {} + virtual void TabClosingAt(TabContents* contents, int index); // The specified TabContents at |index| is being detached, perhaps to be // inserted in another TabStripModel. The implementer should take whatever // action is necessary to deal with the TabContents no longer being present. - virtual void TabDetachedAt(TabContents* contents, int index) {} + virtual void TabDetachedAt(TabContents* contents, int index); // The selected TabContents is about to change from |old_contents| at |index|. // This gives observers a chance to prepare for an impending switch before it // happens. - virtual void TabDeselectedAt(TabContents* contents, int index) {} + virtual void TabDeselectedAt(TabContents* contents, int index); // The selected TabContents changed from |old_contents| to |new_contents| at // |index|. |user_gesture| specifies whether or not this was done by a user @@ -82,12 +82,12 @@ class TabStripModelObserver { virtual void TabSelectedAt(TabContents* old_contents, TabContents* new_contents, int index, - bool user_gesture) {} + bool user_gesture); // The specified TabContents at |from_index| was moved to |to_index|. virtual void TabMoved(TabContents* contents, int from_index, - int to_index) {} + int to_index); // The specified TabContents at |index| changed in some way. |contents| may // be an entirely different object and the old value is no longer available @@ -95,40 +95,40 @@ class TabStripModelObserver { // // See TabChangeType for a description of |change_type|. virtual void TabChangedAt(TabContents* contents, int index, - TabChangeType change_type) {} + TabChangeType change_type); // The tab contents was replaced at the specified index. This is invoked when // a tab becomes phantom. See description of phantom tabs in class description // of TabStripModel for details. virtual void TabReplacedAt(TabContents* old_contents, - TabContents* new_contents, int index) {} + TabContents* new_contents, int index); // Invoked when the pinned state of a tab changes. This is not invoked if the // tab ends up moving as a result of the mini state changing. // See note in TabMiniStateChanged as to how this relates to // TabMiniStateChanged. - virtual void TabPinnedStateChanged(TabContents* contents, int index) {} + virtual void TabPinnedStateChanged(TabContents* contents, int index); // Invoked if the mini state of a tab changes. This is not invoked if the // tab ends up moving as a result of the mini state changing. // NOTE: this is sent when the pinned state of a non-app tab changes and is // sent in addition to TabPinnedStateChanged. UI code typically need not care // about TabPinnedStateChanged, but instead this. - virtual void TabMiniStateChanged(TabContents* contents, int index) {} + virtual void TabMiniStateChanged(TabContents* contents, int index); // Invoked when the blocked state of a tab changes. // NOTE: This is invoked when a tab becomes blocked/unblocked by a tab modal // window. - virtual void TabBlockedStateChanged(TabContents* contents, int index) {} + virtual void TabBlockedStateChanged(TabContents* contents, int index); // The TabStripModel now no longer has any phantom tabs. The implementer may // use this as a trigger to try and close the window containing the // TabStripModel, for example... - virtual void TabStripEmpty() {} + virtual void TabStripEmpty(); // Sent when the tabstrip model is about to be deleted and any reference held // must be dropped. - virtual void TabStripModelDeleted() {} + virtual void TabStripModelDeleted(); }; /////////////////////////////////////////////////////////////////////////////// @@ -229,9 +229,7 @@ class TabStripModelDelegate { virtual void BookmarkAllTabs() = 0; // Returns true if any of the tabs can be closed. - virtual bool CanCloseTab() const { - return true; - } + virtual bool CanCloseTab() const; // Returns true if the vertical tabstrip presentation should be used. virtual bool UseVerticalTabs() const = 0; |