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

Unified Diff: chrome/browser/tab_contents/tab_contents_delegate.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/tab_contents/tab_contents_delegate.h ('k') | chrome/browser/ui/browser.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_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(
« no previous file with comments | « chrome/browser/tab_contents/tab_contents_delegate.h ('k') | chrome/browser/ui/browser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698