OLD | NEW |
---|---|
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" |
11 #include "content/public/browser/security_style_explanations.h" | 11 #include "content/public/browser/security_style_explanations.h" |
12 #include "content/public/browser/web_contents.h" | 12 #include "content/public/browser/web_contents.h" |
13 #include "content/public/common/bindings_policy.h" | 13 #include "content/public/common/bindings_policy.h" |
14 #include "content/public/common/security_style.h" | 14 #include "content/public/common/security_style.h" |
15 #include "content/public/common/url_constants.h" | 15 #include "content/public/common/url_constants.h" |
16 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 WebContentsDelegate::WebContentsDelegate() { | 20 WebContentsDelegate::WebContentsDelegate() { |
21 } | 21 } |
22 | 22 |
23 WebContents* WebContentsDelegate::OpenURLFromTab(WebContents* source, | 23 WebContents* WebContentsDelegate::OpenURLFromTab(WebContents* source, |
24 const OpenURLParams& params) { | 24 const OpenURLParams& params) { |
25 return nullptr; | 25 // CURRENT_TAB is the only one we implement for now. |
Charlie Reis
2015/11/25 00:05:28
// This default implementation only handles CURREN
alexmos
2015/11/25 19:15:39
Done.
| |
26 if (params.disposition != CURRENT_TAB) | |
27 return nullptr; | |
28 | |
29 NavigationController::LoadURLParams load_url_params(params.url); | |
30 load_url_params.source_site_instance = params.source_site_instance; | |
Charlie Reis
2015/11/25 00:05:28
Let's make sure we cover all the parameters from O
alexmos
2015/11/25 19:15:39
I've added redirect_chain and rearranged them.
I'
Charlie Reis
2015/11/25 19:34:25
Seems right.
| |
31 load_url_params.referrer = params.referrer; | |
32 load_url_params.frame_tree_node_id = params.frame_tree_node_id; | |
33 load_url_params.transition_type = params.transition; | |
34 load_url_params.extra_headers = params.extra_headers; | |
35 load_url_params.should_replace_current_entry = | |
36 params.should_replace_current_entry; | |
37 | |
38 if (params.transferred_global_request_id != GlobalRequestID()) { | |
39 load_url_params.is_renderer_initiated = params.is_renderer_initiated; | |
40 load_url_params.transferred_global_request_id = | |
41 params.transferred_global_request_id; | |
42 } else if (params.is_renderer_initiated) { | |
43 load_url_params.is_renderer_initiated = true; | |
Charlie Reis
2015/11/25 00:05:28
I can't figure out why shell.cc had this obscure a
alexmos
2015/11/25 19:15:39
Done. Same seems to be true for transferred_globa
Charlie Reis
2015/11/25 19:34:25
Ah, yes, nice find. Specifically:
https://coderev
| |
44 } | |
45 | |
46 source->GetController().LoadURLWithParams(load_url_params); | |
47 return source; | |
26 } | 48 } |
27 | 49 |
28 bool WebContentsDelegate::IsPopupOrPanel(const WebContents* source) const { | 50 bool WebContentsDelegate::IsPopupOrPanel(const WebContents* source) const { |
29 return false; | 51 return false; |
30 } | 52 } |
31 | 53 |
32 bool WebContentsDelegate::CanOverscrollContent() const { return false; } | 54 bool WebContentsDelegate::CanOverscrollContent() const { return false; } |
33 | 55 |
34 gfx::Rect WebContentsDelegate::GetRootWindowResizerRect() const { | 56 gfx::Rect WebContentsDelegate::GetRootWindowResizerRect() const { |
35 return gfx::Rect(); | 57 return gfx::Rect(); |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
248 SecurityStyleExplanations* security_style_explanations) { | 270 SecurityStyleExplanations* security_style_explanations) { |
249 return content::SECURITY_STYLE_UNKNOWN; | 271 return content::SECURITY_STYLE_UNKNOWN; |
250 } | 272 } |
251 | 273 |
252 void WebContentsDelegate::ShowCertificateViewerInDevTools( | 274 void WebContentsDelegate::ShowCertificateViewerInDevTools( |
253 WebContents* web_contents, | 275 WebContents* web_contents, |
254 int cert_id) { | 276 int cert_id) { |
255 } | 277 } |
256 | 278 |
257 } // namespace content | 279 } // namespace content |
OLD | NEW |