OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/shell/browser/shell.h" | 5 #include "content/shell/browser/shell.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 devtools_frontend_->Close(); | 263 devtools_frontend_->Close(); |
264 devtools_frontend_ = NULL; | 264 devtools_frontend_ = NULL; |
265 } | 265 } |
266 | 266 |
267 gfx::NativeView Shell::GetContentView() { | 267 gfx::NativeView Shell::GetContentView() { |
268 if (!web_contents_) | 268 if (!web_contents_) |
269 return NULL; | 269 return NULL; |
270 return web_contents_->GetNativeView(); | 270 return web_contents_->GetNativeView(); |
271 } | 271 } |
272 | 272 |
273 WebContents* Shell::OpenURLFromTab(WebContents* source, | |
274 const OpenURLParams& params) { | |
275 // This implementation only handles CURRENT_TAB. | |
276 if (params.disposition != CURRENT_TAB) | |
277 return nullptr; | |
278 | |
279 NavigationController::LoadURLParams load_url_params(params.url); | |
280 load_url_params.source_site_instance = params.source_site_instance; | |
281 load_url_params.transition_type = params.transition; | |
282 load_url_params.frame_tree_node_id = params.frame_tree_node_id; | |
283 load_url_params.referrer = params.referrer; | |
284 load_url_params.redirect_chain = params.redirect_chain; | |
285 load_url_params.extra_headers = params.extra_headers; | |
286 load_url_params.is_renderer_initiated = params.is_renderer_initiated; | |
287 load_url_params.transferred_global_request_id = | |
288 params.transferred_global_request_id; | |
289 load_url_params.should_replace_current_entry = | |
290 params.should_replace_current_entry; | |
291 | |
292 // Only allows the browser-initiated navigation to use POST. | |
Charlie Reis
2016/01/06 00:03:18
This wasn't in the previous Shell::OpenURLFromTab
| |
293 if (params.uses_post && !params.is_renderer_initiated) { | |
294 load_url_params.load_type = | |
295 NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST; | |
296 load_url_params.browser_initiated_post_data = | |
297 params.browser_initiated_post_data; | |
298 } | |
299 | |
300 source->GetController().LoadURLWithParams(load_url_params); | |
301 return source; | |
302 } | |
303 | |
273 void Shell::LoadingStateChanged(WebContents* source, | 304 void Shell::LoadingStateChanged(WebContents* source, |
274 bool to_different_document) { | 305 bool to_different_document) { |
275 UpdateNavigationControls(to_different_document); | 306 UpdateNavigationControls(to_different_document); |
276 PlatformSetIsLoading(source->IsLoading()); | 307 PlatformSetIsLoading(source->IsLoading()); |
277 } | 308 } |
278 | 309 |
279 void Shell::EnterFullscreenModeForTab(WebContents* web_contents, | 310 void Shell::EnterFullscreenModeForTab(WebContents* web_contents, |
280 const GURL& origin) { | 311 const GURL& origin) { |
281 ToggleFullscreenModeForTab(web_contents, true); | 312 ToggleFullscreenModeForTab(web_contents, true); |
282 } | 313 } |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
420 devtools_frontend_->Activate(); | 451 devtools_frontend_->Activate(); |
421 devtools_frontend_->Focus(); | 452 devtools_frontend_->Focus(); |
422 } | 453 } |
423 | 454 |
424 void Shell::OnDevToolsWebContentsDestroyed() { | 455 void Shell::OnDevToolsWebContentsDestroyed() { |
425 devtools_observer_.reset(); | 456 devtools_observer_.reset(); |
426 devtools_frontend_ = NULL; | 457 devtools_frontend_ = NULL; |
427 } | 458 } |
428 | 459 |
429 } // namespace content | 460 } // namespace content |
OLD | NEW |