Index: chrome/browser/tab_contents/tab_contents_delegate.cc |
diff --git a/chrome/browser/tab_contents/tab_contents_delegate.cc b/chrome/browser/tab_contents/tab_contents_delegate.cc |
index 319407d08aafb8b84407716ab58b0ace64a0099e..3b16cf96e77ae800e5fa69b0a395522635632d46 100644 |
--- a/chrome/browser/tab_contents/tab_contents_delegate.cc |
+++ b/chrome/browser/tab_contents/tab_contents_delegate.cc |
@@ -5,6 +5,7 @@ |
#include "chrome/browser/tab_contents/tab_contents_delegate.h" |
#include "chrome/browser/search_engines/template_url.h" |
+#include "chrome/common/url_constants.h" |
#include "gfx/rect.h" |
std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) { |
@@ -131,7 +132,18 @@ void TabContentsDelegate::ShowPageInfo(Profile* profile, |
bool show_history) { |
} |
-void TabContentsDelegate::ViewSourceForTab(TabContents* source) { |
+void TabContentsDelegate::ViewSourceForTab(TabContents* source, |
+ const GURL& page_url) { |
+ // Fall back implementation based entirely on the view-source scheme. |
+ // It suffers from http://crbug.com/523 and that is why browser overrides |
+ // it with proper implementation. |
+ GURL url = GURL(chrome::kViewSourceScheme + std::string(":") + |
+ page_url.spec()); |
+ OpenURLFromTab(source, |
+ url, |
+ GURL(), |
+ NEW_FOREGROUND_TAB, |
+ PageTransition::LINK); |
} |
bool TabContentsDelegate::PreHandleKeyboardEvent( |