summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tabs
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 23:20:20 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-08 23:20:20 +0000
commita206b446481a9d522958a98e03912aba8c02bb4b (patch)
treeef94c7d31020aaa871117fa1d23b352db34f0940 /chrome/browser/tabs
parent96a41a0ec6889b5923a92454eafaf39fd63277cf (diff)
downloadchromium_src-a206b446481a9d522958a98e03912aba8c02bb4b.zip
chromium_src-a206b446481a9d522958a98e03912aba8c02bb4b.tar.gz
chromium_src-a206b446481a9d522958a98e03912aba8c02bb4b.tar.bz2
* Add ctrl-shift-d to bookmark all tabs.
* Enable or disable bookmark commands based on whether we're actually going to be able to bookmark anything. * Rename IDC_STAR to IDC_BOOKMARK_PAGE, which is more obvious. BUG=2935 TEST=Hit ctrl-shift-d, make sure it bookmarks all tabs Review URL: http://codereview.chromium.org/266029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28480 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc5
-rw-r--r--chrome/browser/tabs/tab_strip_model.h4
-rw-r--r--chrome/browser/tabs/tab_strip_model_unittest.cc1
3 files changed, 6 insertions, 4 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index 9ceb6d8..a0802f9 100644
--- a/chrome/browser/tabs/tab_strip_model.cc
+++ b/chrome/browser/tabs/tab_strip_model.cc
@@ -488,10 +488,7 @@ bool TabStripModel::IsContextMenuCommandEnabled(
case CommandTogglePinned:
return true;
case CommandBookmarkAllTabs: {
- if (count() <= 1)
- return false;
- BookmarkModel* model = profile_->GetBookmarkModel();
- return model && model->IsLoaded();
+ return delegate_->CanBookmarkAllTabs();
}
default:
NOTREACHED();
diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h
index 9e7659e..0c70378 100644
--- a/chrome/browser/tabs/tab_strip_model.h
+++ b/chrome/browser/tabs/tab_strip_model.h
@@ -200,6 +200,10 @@ class TabStripModelDelegate {
// Returns whether some contents can be closed.
virtual bool CanCloseContentsAt(int index) = 0;
+ // Returns true if we should allow "bookmark all tabs" in this window; this is
+ // true when there is more than one bookmarkable tab open.
+ virtual bool CanBookmarkAllTabs() const = 0;
+
// Creates a bookmark folder containing a bookmark for all open tabs.
virtual void BookmarkAllTabs() = 0;
};
diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc
index 5beb59f..949d29e 100644
--- a/chrome/browser/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/tabs/tab_strip_model_unittest.cc
@@ -65,6 +65,7 @@ class TabStripDummyDelegate : public TabStripModelDelegate {
virtual bool CanRestoreTab() { return false; }
virtual void RestoreTab() {}
virtual bool CanCloseContentsAt(int index) { return can_close_ ; }
+ virtual bool CanBookmarkAllTabs() const { return false; }
virtual void BookmarkAllTabs() {}
private: