OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/background/background_contents_service.h" | 5 #include "chrome/browser/background/background_contents_service.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 BackgroundContents* contents = CreateBackgroundContents( | 449 BackgroundContents* contents = CreateBackgroundContents( |
450 SiteInstance::CreateSiteInstanceForURL(profile, url), | 450 SiteInstance::CreateSiteInstanceForURL(profile, url), |
451 MSG_ROUTING_NONE, | 451 MSG_ROUTING_NONE, |
452 profile, | 452 profile, |
453 frame_name, | 453 frame_name, |
454 application_id); | 454 application_id); |
455 | 455 |
456 // TODO(atwilson): Create RenderViews asynchronously to avoid increasing | 456 // TODO(atwilson): Create RenderViews asynchronously to avoid increasing |
457 // startup latency (http://crbug.com/47236). | 457 // startup latency (http://crbug.com/47236). |
458 contents->tab_contents()->controller().LoadURL( | 458 contents->tab_contents()->controller().LoadURL( |
459 url, GURL(), content::PAGE_TRANSITION_LINK, std::string()); | 459 url, content::Referrer(), content::PAGE_TRANSITION_LINK, std::string()); |
460 } | 460 } |
461 | 461 |
462 BackgroundContents* BackgroundContentsService::CreateBackgroundContents( | 462 BackgroundContents* BackgroundContentsService::CreateBackgroundContents( |
463 SiteInstance* site, | 463 SiteInstance* site, |
464 int routing_id, | 464 int routing_id, |
465 Profile* profile, | 465 Profile* profile, |
466 const string16& frame_name, | 466 const string16& frame_name, |
467 const string16& application_id) { | 467 const string16& application_id) { |
468 BackgroundContents* contents = new BackgroundContents(site, routing_id, this); | 468 BackgroundContents* contents = new BackgroundContents(site, routing_id, this); |
469 | 469 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 TabContents* new_contents, | 572 TabContents* new_contents, |
573 WindowOpenDisposition disposition, | 573 WindowOpenDisposition disposition, |
574 const gfx::Rect& initial_pos, | 574 const gfx::Rect& initial_pos, |
575 bool user_gesture) { | 575 bool user_gesture) { |
576 Browser* browser = BrowserList::GetLastActiveWithProfile( | 576 Browser* browser = BrowserList::GetLastActiveWithProfile( |
577 Profile::FromBrowserContext(new_contents->browser_context())); | 577 Profile::FromBrowserContext(new_contents->browser_context())); |
578 if (!browser) | 578 if (!browser) |
579 return; | 579 return; |
580 browser->AddTabContents(new_contents, disposition, initial_pos, user_gesture); | 580 browser->AddTabContents(new_contents, disposition, initial_pos, user_gesture); |
581 } | 581 } |
OLD | NEW |