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

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

Issue 5869002: Introduce default implementation for TabContentsDelegate::ViewSourceForTab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Lint Created 10 years 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/tab_contents_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 7769d34661382507d1813da9d0f4815bd9416f56..a5cf474b9f1869f46621a2955f08e2d2465e5235 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1523,8 +1523,14 @@ int TabContents::GetZoomPercent(bool* enable_increment,
void TabContents::ViewSource()
{
- if (delegate_)
- delegate_->ViewSourceForTab(this);
+ if (!delegate_)
+ return;
+
+ NavigationEntry* active_entry = controller().GetActiveEntry();
+ if (!active_entry)
+ return;
+
+ delegate_->ViewSourceForTab(this, active_entry->url());
}
// Notifies the RenderWidgetHost instance about the fact that the page is
« no previous file with comments | « no previous file | chrome/browser/tab_contents/tab_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698