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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 22831005: Use visible entry for website settings dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix TabSpecificContentSettings Created 7 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
Index: chrome/browser/tab_contents/render_view_context_menu.cc
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index 77b4ff5d7b59d01e78daffdc1c204d8d89a9315f..0d6a5db7ca85d7d8828cf84b343cbae79f0ee9cc 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -1350,6 +1350,7 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
// 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).
+ // TODO(nasko): Audit all GetActiveEntry calls in this file.
NavigationEntry* active_entry =
source_web_contents_->GetController().GetActiveEntry();
return content::IsSavableURL(
@@ -1771,7 +1772,9 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
case IDC_CONTENT_CONTEXT_VIEWPAGEINFO: {
NavigationController* controller = &source_web_contents_->GetController();
- NavigationEntry* nav_entry = controller->GetActiveEntry();
+ // Important to use GetVisibleEntry to match what's showing in the
+ // omnibox.
+ NavigationEntry* nav_entry = controller->GetVisibleEntry();
Browser* browser =
chrome::FindBrowserWithWebContents(source_web_contents_);
chrome::ShowWebsiteSettings(browser, source_web_contents_,

Powered by Google App Engine
This is Rietveld 408576698