diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-25 18:04:59 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-25 18:04:59 +0000 |
commit | 6de74456d80f1f458509ec61c353b7ba2c728b84 (patch) | |
tree | 51912c23a1755d3aa8be422bfb7777fa7ef46860 /chrome/browser/browser.cc | |
parent | 24d2b8f01cca7f68cdb526c03a15f75a7feec35b (diff) | |
download | chromium_src-6de74456d80f1f458509ec61c353b7ba2c728b84.zip chromium_src-6de74456d80f1f458509ec61c353b7ba2c728b84.tar.gz chromium_src-6de74456d80f1f458509ec61c353b7ba2c728b84.tar.bz2 |
Delete the ViewSourceTabContents.
This removes all the tab contents type stuff for view source mode. The
RenderViewHostManager now automatically switches RenderViews when we turn view
source mode on or off to get the desired effect.
I also moved some instances of hardcoded schemes into chrome_constants.h, and
renamed RendererCreated/Ready/Gone to RenderViewCreated/Ready/Gone to reflect
what they actually mean.
Review URL: http://codereview.chromium.org/28089
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10346 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser.cc')
-rw-r--r-- | chrome/browser/browser.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index c4bc67b..6866cf4 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -2032,6 +2032,9 @@ void Browser::UpdateCommandsForTabState() { WebContents* web_contents = current_tab->AsWebContents(); bool is_web_contents = web_contents != NULL; + // Current navigation entry, may be NULL. + NavigationEntry* active_entry = current_tab->controller()->GetActiveEntry(); + // Page-related commands // Only allow bookmarking for web content in normal windows. command_updater_.UpdateCommandEnabled(IDC_STAR, @@ -2039,8 +2042,7 @@ void Browser::UpdateCommandsForTabState() { window_->SetStarredState(is_web_contents && web_contents->is_starred()); // View-source should not be enabled if already in view-source mode. command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, - is_web_contents && (current_tab->type() != TAB_CONTENTS_VIEW_SOURCE) && - current_tab->controller()->GetActiveEntry()); + is_web_contents && active_entry && !active_entry->IsViewSourceMode()); command_updater_.UpdateCommandEnabled(IDC_PRINT, is_web_contents); command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE, is_web_contents && SavePackage::IsSavableURL(current_tab->GetURL())); |