diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 00:41:26 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-12-11 00:41:26 +0000 |
commit | 5d3611de2eb0dd1aa8e82bd5bfc492acb8b41a46 (patch) | |
tree | fd6f8e470be2e23ca6b1361d5d5ee10bb56eebc0 /chrome/browser | |
parent | c311074f821fe0b89b44c3e06d02936b1da1c296 (diff) | |
download | chromium_src-5d3611de2eb0dd1aa8e82bd5bfc492acb8b41a46.zip chromium_src-5d3611de2eb0dd1aa8e82bd5bfc492acb8b41a46.tar.gz chromium_src-5d3611de2eb0dd1aa8e82bd5bfc492acb8b41a46.tar.bz2 |
Only allow bookmark keyboard shortcut for tabbed browsers.
BUG=5055
TEST=make sure control-d does nothing for apps and popup windows
Review URL: http://codereview.chromium.org/13363
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@6764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index a483241..135e823 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -728,6 +728,13 @@ void Browser::Exit() { } void Browser::BookmarkCurrentPage() { + if (type() != TYPE_NORMAL) { + // We disable bookmarking for types other than normal and shouldn't get + // here. + NOTREACHED(); + return; + } + UserMetrics::RecordAction(L"Star", profile_); TabContents* tab = GetSelectedTabContents(); @@ -2014,7 +2021,8 @@ void Browser::UpdateCommandsForTabState() { WebContents* web_contents = current_tab->AsWebContents(); if (web_contents) { // Page-related commands - controller_.UpdateCommandEnabled(IDC_STAR, true); + // Only allow bookmarking for tabbed browsers. + controller_.UpdateCommandEnabled(IDC_STAR, type() == TYPE_NORMAL); SetStarredButtonToggled(web_contents->is_starred()); // View-source should not be enabled if already in view-source mode. controller_.UpdateCommandEnabled(IDC_VIEW_SOURCE, |