| 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 "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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 223 } |
| 224 | 224 |
| 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 // CURRENT_TAB is the only one we implement for now. |
| 234 DCHECK(params.disposition == CURRENT_TAB); | 234 if (params.disposition != CURRENT_TAB) |
| 235 return NULL; |
| 235 NavigationController::LoadURLParams load_url_params(params.url); | 236 NavigationController::LoadURLParams load_url_params(params.url); |
| 236 load_url_params.referrer = params.referrer; | 237 load_url_params.referrer = params.referrer; |
| 237 load_url_params.transition_type = params.transition; | 238 load_url_params.transition_type = params.transition; |
| 238 load_url_params.extra_headers = params.extra_headers; | 239 load_url_params.extra_headers = params.extra_headers; |
| 239 load_url_params.should_replace_current_entry = | 240 load_url_params.should_replace_current_entry = |
| 240 params.should_replace_current_entry; | 241 params.should_replace_current_entry; |
| 241 | 242 |
| 242 if (params.transferred_global_request_id != GlobalRequestID()) { | 243 if (params.transferred_global_request_id != GlobalRequestID()) { |
| 243 load_url_params.is_renderer_initiated = params.is_renderer_initiated; | 244 load_url_params.is_renderer_initiated = params.is_renderer_initiated; |
| 244 load_url_params.transferred_global_request_id = | 245 load_url_params.transferred_global_request_id = |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 NOTREACHED(); | 359 NOTREACHED(); |
| 359 } | 360 } |
| 360 } | 361 } |
| 361 | 362 |
| 362 void Shell::OnDevToolsWebContentsDestroyed() { | 363 void Shell::OnDevToolsWebContentsDestroyed() { |
| 363 devtools_observer_.reset(); | 364 devtools_observer_.reset(); |
| 364 devtools_frontend_ = NULL; | 365 devtools_frontend_ = NULL; |
| 365 } | 366 } |
| 366 | 367 |
| 367 } // namespace content | 368 } // namespace content |
| OLD | NEW |