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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/tab_contents/tab_contents_delegate.h" 5 #include "chrome/browser/tab_contents/tab_contents_delegate.h"
6 6
7 #include "chrome/browser/search_engines/template_url.h" 7 #include "chrome/browser/search_engines/template_url.h"
8 #include "chrome/common/url_constants.h"
8 #include "gfx/rect.h" 9 #include "gfx/rect.h"
9 10
10 std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) { 11 std::string TabContentsDelegate::GetNavigationHeaders(const GURL& url) {
11 return std::string(); 12 return std::string();
12 } 13 }
13 14
14 void TabContentsDelegate::DetachContents(TabContents* source) { 15 void TabContentsDelegate::DetachContents(TabContents* source) {
15 } 16 }
16 17
17 bool TabContentsDelegate::IsPopup(const TabContents* source) const { 18 bool TabContentsDelegate::IsPopup(const TabContents* source) const {
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 Profile* profile) { 125 Profile* profile) {
125 delete template_url; 126 delete template_url;
126 } 127 }
127 128
128 void TabContentsDelegate::ShowPageInfo(Profile* profile, 129 void TabContentsDelegate::ShowPageInfo(Profile* profile,
129 const GURL& url, 130 const GURL& url,
130 const NavigationEntry::SSLStatus& ssl, 131 const NavigationEntry::SSLStatus& ssl,
131 bool show_history) { 132 bool show_history) {
132 } 133 }
133 134
134 void TabContentsDelegate::ViewSourceForTab(TabContents* source) { 135 void TabContentsDelegate::ViewSourceForTab(TabContents* source,
136 const GURL& page_url) {
137 // Fall back implementation based entirely on the view-source scheme.
138 // It suffers from http://crbug.com/523 and that is why browser overrides
139 // it with proper implementation.
140 GURL url = GURL(chrome::kViewSourceScheme + std::string(":") +
141 page_url.spec());
142 OpenURLFromTab(source,
143 url,
144 GURL(),
145 NEW_FOREGROUND_TAB,
146 PageTransition::LINK);
135 } 147 }
136 148
137 bool TabContentsDelegate::PreHandleKeyboardEvent( 149 bool TabContentsDelegate::PreHandleKeyboardEvent(
138 const NativeWebKeyboardEvent& event, 150 const NativeWebKeyboardEvent& event,
139 bool* is_keyboard_shortcut) { 151 bool* is_keyboard_shortcut) {
140 return false; 152 return false;
141 } 153 }
142 154
143 void TabContentsDelegate::HandleKeyboardEvent( 155 void TabContentsDelegate::HandleKeyboardEvent(
144 const NativeWebKeyboardEvent& event) { 156 const NativeWebKeyboardEvent& event) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 219
208 void TabContentsDelegate::OnInstantSupportDetermined(int32 page_id, 220 void TabContentsDelegate::OnInstantSupportDetermined(int32 page_id,
209 bool result) { 221 bool result) {
210 } 222 }
211 223
212 void TabContentsDelegate::ContentRestrictionsChanged(TabContents* source) { 224 void TabContentsDelegate::ContentRestrictionsChanged(TabContents* source) {
213 } 225 }
214 226
215 TabContentsDelegate::~TabContentsDelegate() { 227 TabContentsDelegate::~TabContentsDelegate() {
216 } 228 }
OLDNEW
« 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