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

Side by Side Diff: content/public/browser/web_contents_delegate.cc

Issue 10837112: Add WebContents* to some more WebContentsDelegate methods (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 8 years, 4 months 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 | « content/public/browser/web_contents_delegate.h ('k') | content/shell/shell.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/public/browser/web_contents_delegate.h" 5 #include "content/public/browser/web_contents_delegate.h"
6 6
7 #include "base/compiler_specific.h" 7 #include "base/compiler_specific.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/singleton.h" 9 #include "base/memory/singleton.h"
10 #include "content/public/browser/render_view_host.h" 10 #include "content/public/browser/render_view_host.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 void WebContentsDelegate::BeforeUnloadFired(WebContents* web_contents, 52 void WebContentsDelegate::BeforeUnloadFired(WebContents* web_contents,
53 bool proceed, 53 bool proceed,
54 bool* proceed_to_fire_unload) { 54 bool* proceed_to_fire_unload) {
55 *proceed_to_fire_unload = true; 55 *proceed_to_fire_unload = true;
56 } 56 }
57 57
58 bool WebContentsDelegate::ShouldFocusPageAfterCrash() { 58 bool WebContentsDelegate::ShouldFocusPageAfterCrash() {
59 return true; 59 return true;
60 } 60 }
61 61
62 bool WebContentsDelegate::TakeFocus(bool reverse) { 62 bool WebContentsDelegate::TakeFocus(WebContents* soruce, bool reverse) {
63 return false; 63 return false;
64 } 64 }
65 65
66 int WebContentsDelegate::GetExtraRenderViewHeight() const { 66 int WebContentsDelegate::GetExtraRenderViewHeight() const {
67 return 0; 67 return 0;
68 } 68 }
69 69
70 bool WebContentsDelegate::CanDownload(RenderViewHost* render_view_host, 70 bool WebContentsDelegate::CanDownload(RenderViewHost* render_view_host,
71 int request_id, 71 int request_id,
72 const std::string& request_method) { 72 const std::string& request_method) {
(...skipping 26 matching lines...) Expand all
99 const std::string& content_state) { 99 const std::string& content_state) {
100 // Same as ViewSourceForTab, but for given subframe. 100 // Same as ViewSourceForTab, but for given subframe.
101 GURL url = GURL(chrome::kViewSourceScheme + std::string(":") + 101 GURL url = GURL(chrome::kViewSourceScheme + std::string(":") +
102 frame_url.spec()); 102 frame_url.spec());
103 OpenURLFromTab(source, OpenURLParams(url, Referrer(), 103 OpenURLFromTab(source, OpenURLParams(url, Referrer(),
104 NEW_FOREGROUND_TAB, 104 NEW_FOREGROUND_TAB,
105 PAGE_TRANSITION_LINK, false)); 105 PAGE_TRANSITION_LINK, false));
106 } 106 }
107 107
108 bool WebContentsDelegate::PreHandleKeyboardEvent( 108 bool WebContentsDelegate::PreHandleKeyboardEvent(
109 WebContents* source,
109 const NativeWebKeyboardEvent& event, 110 const NativeWebKeyboardEvent& event,
110 bool* is_keyboard_shortcut) { 111 bool* is_keyboard_shortcut) {
111 return false; 112 return false;
112 } 113 }
113 114
114 bool WebContentsDelegate::OnGoToEntryOffset(int offset) { 115 bool WebContentsDelegate::OnGoToEntryOffset(int offset) {
115 return true; 116 return true;
116 } 117 }
117 118
118 bool WebContentsDelegate::ShouldAddNavigationToHistory( 119 bool WebContentsDelegate::ShouldAddNavigationToHistory(
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end()); 171 DCHECK(attached_contents_.find(web_contents) == attached_contents_.end());
171 attached_contents_.insert(web_contents); 172 attached_contents_.insert(web_contents);
172 } 173 }
173 174
174 void WebContentsDelegate::Detach(WebContents* web_contents) { 175 void WebContentsDelegate::Detach(WebContents* web_contents) {
175 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end()); 176 DCHECK(attached_contents_.find(web_contents) != attached_contents_.end());
176 attached_contents_.erase(web_contents); 177 attached_contents_.erase(web_contents);
177 } 178 }
178 179
179 } // namespace content 180 } // namespace content
OLDNEW
« no previous file with comments | « content/public/browser/web_contents_delegate.h ('k') | content/shell/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698