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

Unified Diff: chrome/browser/ui/browser.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 | « chrome/browser/ui/browser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.cc
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 8e8f55f7bc6d9d234a4f975732ef926a21f7082e..8ab93c0fd22a0db3c20078fe49c3d28898187142 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -3051,9 +3051,9 @@ void Browser::ShowPageInfo(Profile* profile,
window()->ShowPageInfo(profile, url, ssl, show_history);
}
-void Browser::ViewSourceForTab(TabContents* contents) {
- DCHECK(contents);
- int index = tabstrip_model()->GetWrapperIndex(contents);
+void Browser::ViewSourceForTab(TabContents* source, const GURL& page_url) {
+ DCHECK(source);
+ int index = tabstrip_model()->GetWrapperIndex(source);
TabContentsWrapper* wrapper = tabstrip_model()->GetTabContentsAt(index);
ViewSource(wrapper);
}
@@ -4133,6 +4133,9 @@ void Browser::ViewSource(TabContentsWrapper* contents) {
view_source_contents->controller().PruneAllButActive();
NavigationEntry* active_entry =
view_source_contents->controller().GetActiveEntry();
+ if (!active_entry)
+ return;
+
GURL url = GURL(chrome::kViewSourceScheme + std::string(":") +
active_entry->url().spec());
active_entry->set_virtual_url(url);
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698