Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc |
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc |
index 58c38603bc9b9e6ae64344d07ccfbd529ca08126..50f326aeda52833f211e4db4ac4110ac94e2be3c 100644 |
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc |
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc |
@@ -1163,7 +1163,8 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { |
return IsDevCommandEnabled(id); |
case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: |
- if (embedder_web_contents_->GetController().GetVisibleEntry() == NULL) |
+ // Disabled for initial navigation. |
+ if (embedder_web_contents_->GetController().IsInitialNavigation()) |
return false; |
// Disabled if no browser is associated (e.g. desktop notifications). |
if (chrome::FindBrowserWithWebContents(embedder_web_contents_) == NULL) |
@@ -1314,7 +1315,7 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { |
// opposed to any pending URL that hasn't committed yet. |
NavigationEntry* entry = |
embedder_web_contents_->GetController().GetLastCommittedEntry(); |
- return content::IsSavableURL(entry ? entry->GetURL() : GURL()); |
+ return content::IsSavableURL(entry->GetURL()); |
} |
case IDC_CONTENT_CONTEXT_RELOADFRAME: |
@@ -1734,10 +1735,8 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) { |
NavigationController* controller = |
&embedder_web_contents_->GetController(); |
// Important to use GetVisibleEntry to match what's showing in the |
- // omnibox. This may return null. |
+ // omnibox. |
NavigationEntry* nav_entry = controller->GetVisibleEntry(); |
- if (!nav_entry) |
- return; |
Browser* browser = |
chrome::FindBrowserWithWebContents(embedder_web_contents_); |
SecurityStateModel* security_model = |