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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
172 | 172 |
173 void Shell::LoadURLForFrame(const GURL& url, const std::string& frame_name) { | 173 void Shell::LoadURLForFrame(const GURL& url, const std::string& frame_name) { |
174 NavigationController::LoadURLParams params(url); | 174 NavigationController::LoadURLParams params(url); |
175 params.transition_type = PageTransitionFromInt( | 175 params.transition_type = PageTransitionFromInt( |
176 PAGE_TRANSITION_TYPED | PAGE_TRANSITION_FROM_ADDRESS_BAR); | 176 PAGE_TRANSITION_TYPED | PAGE_TRANSITION_FROM_ADDRESS_BAR); |
177 params.frame_name = frame_name; | 177 params.frame_name = frame_name; |
178 web_contents_->GetController().LoadURLWithParams(params); | 178 web_contents_->GetController().LoadURLWithParams(params); |
179 web_contents_->GetView()->Focus(); | 179 web_contents_->GetView()->Focus(); |
180 } | 180 } |
181 | 181 |
182 void Shell::LoadDataWithBaseURL(const GURL& base_url, const std::string& data, | |
darin (slow to review)
2014/03/27 08:10:28
nit: since this method is named LoadDataWithBaseUR
hush (inactive)
2014/03/27 20:15:00
Done.
| |
183 const GURL& history_url) { | |
184 const GURL url = GURL("data:text/html;charset=utf-8," + data); | |
185 NavigationController::LoadURLParams params(url); | |
186 params.load_type = NavigationController::LOAD_TYPE_DATA; | |
187 params.base_url_for_data_url = base_url; | |
188 params.virtual_url_for_data_url = history_url; | |
189 params.override_user_agent = NavigationController::UA_OVERRIDE_FALSE; | |
190 web_contents_->GetController().LoadURLWithParams(params); | |
191 web_contents_->GetView()->Focus(); | |
192 } | |
darin (slow to review)
2014/03/27 08:10:28
nit: add a new line below here.
hush (inactive)
2014/03/27 20:15:00
Done.
| |
182 void Shell::AddNewContents(WebContents* source, | 193 void Shell::AddNewContents(WebContents* source, |
183 WebContents* new_contents, | 194 WebContents* new_contents, |
184 WindowOpenDisposition disposition, | 195 WindowOpenDisposition disposition, |
185 const gfx::Rect& initial_pos, | 196 const gfx::Rect& initial_pos, |
186 bool user_gesture, | 197 bool user_gesture, |
187 bool* was_blocked) { | 198 bool* was_blocked) { |
188 CreateShell(new_contents, AdjustWindowSize(initial_pos.size())); | 199 CreateShell(new_contents, AdjustWindowSize(initial_pos.size())); |
189 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 200 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
190 NotifyDoneForwarder::CreateForWebContents(new_contents); | 201 NotifyDoneForwarder::CreateForWebContents(new_contents); |
191 } | 202 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 devtools_frontend_->Activate(); | 384 devtools_frontend_->Activate(); |
374 devtools_frontend_->Focus(); | 385 devtools_frontend_->Focus(); |
375 } | 386 } |
376 | 387 |
377 void Shell::OnDevToolsWebContentsDestroyed() { | 388 void Shell::OnDevToolsWebContentsDestroyed() { |
378 devtools_observer_.reset(); | 389 devtools_observer_.reset(); |
379 devtools_frontend_ = NULL; | 390 devtools_frontend_ = NULL; |
380 } | 391 } |
381 | 392 |
382 } // namespace content | 393 } // namespace content |
OLD | NEW |