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/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 params.base_url_for_data_url = base_url; | 206 params.base_url_for_data_url = base_url; |
207 params.virtual_url_for_data_url = url; | 207 params.virtual_url_for_data_url = url; |
208 params.override_user_agent = NavigationController::UA_OVERRIDE_FALSE; | 208 params.override_user_agent = NavigationController::UA_OVERRIDE_FALSE; |
209 web_contents_->GetController().LoadURLWithParams(params); | 209 web_contents_->GetController().LoadURLWithParams(params); |
210 web_contents_->Focus(); | 210 web_contents_->Focus(); |
211 } | 211 } |
212 | 212 |
213 void Shell::AddNewContents(WebContents* source, | 213 void Shell::AddNewContents(WebContents* source, |
214 WebContents* new_contents, | 214 WebContents* new_contents, |
215 WindowOpenDisposition disposition, | 215 WindowOpenDisposition disposition, |
216 const gfx::Rect& initial_pos, | 216 const gfx::Rect& initial_rect, |
217 bool user_gesture, | 217 bool user_gesture, |
218 bool* was_blocked) { | 218 bool* was_blocked) { |
219 CreateShell(new_contents, AdjustWindowSize(initial_pos.size())); | 219 CreateShell(new_contents, AdjustWindowSize(initial_rect.size())); |
220 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 220 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
221 switches::kDumpRenderTree)) | 221 switches::kDumpRenderTree)) |
222 NotifyDoneForwarder::CreateForWebContents(new_contents); | 222 NotifyDoneForwarder::CreateForWebContents(new_contents); |
223 } | 223 } |
224 | 224 |
225 void Shell::GoBackOrForward(int offset) { | 225 void Shell::GoBackOrForward(int offset) { |
226 web_contents_->GetController().GoToOffset(offset); | 226 web_contents_->GetController().GoToOffset(offset); |
227 web_contents_->Focus(); | 227 web_contents_->Focus(); |
228 } | 228 } |
229 | 229 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 devtools_frontend_->Activate(); | 423 devtools_frontend_->Activate(); |
424 devtools_frontend_->Focus(); | 424 devtools_frontend_->Focus(); |
425 } | 425 } |
426 | 426 |
427 void Shell::OnDevToolsWebContentsDestroyed() { | 427 void Shell::OnDevToolsWebContentsDestroyed() { |
428 devtools_observer_.reset(); | 428 devtools_observer_.reset(); |
429 devtools_frontend_ = NULL; | 429 devtools_frontend_ = NULL; |
430 } | 430 } |
431 | 431 |
432 } // namespace content | 432 } // namespace content |
OLD | NEW |