| 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/shell/shell.h" | 5 #include "content/shell/shell.h" |
| 6 | 6 |
| 7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 gfx::NativeView Shell::GetContentView() { | 225 gfx::NativeView Shell::GetContentView() { |
| 226 if (!web_contents_) | 226 if (!web_contents_) |
| 227 return NULL; | 227 return NULL; |
| 228 return web_contents_->GetView()->GetNativeView(); | 228 return web_contents_->GetView()->GetNativeView(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 WebContents* Shell::OpenURLFromTab(WebContents* source, | 231 WebContents* Shell::OpenURLFromTab(WebContents* source, |
| 232 const OpenURLParams& params) { | 232 const OpenURLParams& params) { |
| 233 // The only one we implement for now. | 233 // The only one we implement for now. |
| 234 DCHECK(params.disposition == CURRENT_TAB); | 234 DCHECK(params.disposition == CURRENT_TAB); |
| 235 source->GetController().LoadURL( | 235 NavigationController::LoadURLParams load_url_params(params.url); |
| 236 params.url, params.referrer, params.transition, std::string()); | 236 load_url_params.referrer = params.referrer; |
| 237 load_url_params.transition_type = params.transition; |
| 238 load_url_params.extra_headers = params.extra_headers; |
| 239 load_url_params.should_replace_current_entry = |
| 240 params.should_replace_current_entry; |
| 241 |
| 242 if (params.transferred_global_request_id != GlobalRequestID()) { |
| 243 load_url_params.is_renderer_initiated = params.is_renderer_initiated; |
| 244 load_url_params.transferred_global_request_id = |
| 245 params.transferred_global_request_id; |
| 246 } else if (params.is_renderer_initiated) { |
| 247 load_url_params.is_renderer_initiated = true; |
| 248 } |
| 249 |
| 250 source->GetController().LoadURLWithParams(load_url_params); |
| 237 return source; | 251 return source; |
| 238 } | 252 } |
| 239 | 253 |
| 240 void Shell::LoadingStateChanged(WebContents* source) { | 254 void Shell::LoadingStateChanged(WebContents* source) { |
| 241 UpdateNavigationControls(); | 255 UpdateNavigationControls(); |
| 242 PlatformSetIsLoading(source->IsLoading()); | 256 PlatformSetIsLoading(source->IsLoading()); |
| 243 } | 257 } |
| 244 | 258 |
| 245 void Shell::ToggleFullscreenModeForTab(WebContents* web_contents, | 259 void Shell::ToggleFullscreenModeForTab(WebContents* web_contents, |
| 246 bool enter_fullscreen) { | 260 bool enter_fullscreen) { |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 NOTREACHED(); | 358 NOTREACHED(); |
| 345 } | 359 } |
| 346 } | 360 } |
| 347 | 361 |
| 348 void Shell::OnDevToolsWebContentsDestroyed() { | 362 void Shell::OnDevToolsWebContentsDestroyed() { |
| 349 devtools_observer_.reset(); | 363 devtools_observer_.reset(); |
| 350 devtools_frontend_ = NULL; | 364 devtools_frontend_ = NULL; |
| 351 } | 365 } |
| 352 | 366 |
| 353 } // namespace content | 367 } // namespace content |
| OLD | NEW |