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

Unified Diff: chrome/browser/browser.cc

Issue 165068: Enabling "Save as..." in view:source page.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/tab_contents/render_view_context_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
===================================================================
--- chrome/browser/browser.cc (revision 24078)
+++ chrome/browser/browser.cc (working copy)
@@ -2274,11 +2274,18 @@
command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE,
active_entry && !active_entry->IsViewSourceMode() &&
is_source_viewable);
+
+ // Instead of using GetURL here, we use url() (which is the "real" url of the
+ // page) from the NavigationEntry because its reflects their origin rather
+ // than the display one (returned by GetURL) which may be different (like
+ // having "view-source:" on the front).
+ GURL savable_url = (active_entry) ? active_entry->url() : GURL::EmptyGURL();
+
command_updater_.UpdateCommandEnabled(IDC_SAVE_PAGE,
- SavePackage::IsSavableURL(current_tab->GetURL()));
+ SavePackage::IsSavableURL(savable_url));
command_updater_.UpdateCommandEnabled(IDC_ENCODING_MENU,
SavePackage::IsSavableContents(current_tab->contents_mime_type()) &&
- SavePackage::IsSavableURL(current_tab->GetURL()));
+ SavePackage::IsSavableURL(savable_url));
// Show various bits of UI
command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS,
« no previous file with comments | « no previous file | chrome/browser/tab_contents/render_view_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698