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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
566 prefs->RegisterDictionaryPref(prefs::kRegisteredBackgroundContents, | 566 prefs->RegisterDictionaryPref(prefs::kRegisteredBackgroundContents, |
567 PrefService::UNSYNCABLE_PREF); | 567 PrefService::UNSYNCABLE_PREF); |
568 } | 568 } |
569 | 569 |
570 void BackgroundContentsService::AddTabContents( | 570 void BackgroundContentsService::AddTabContents( |
571 TabContents* new_contents, | 571 TabContents* new_contents, |
572 WindowOpenDisposition disposition, | 572 WindowOpenDisposition disposition, |
573 const gfx::Rect& initial_pos, | 573 const gfx::Rect& initial_pos, |
574 bool user_gesture) { | 574 bool user_gesture) { |
575 Browser* browser = BrowserList::GetLastActiveWithProfile( | 575 Browser* browser = BrowserList::GetLastActiveWithProfile( |
576 new_contents->profile()); | 576 static_cast<Profile*>(new_contents->browser_context())); |
577 if (!browser) | 577 if (!browser) |
578 return; | 578 return; |
579 browser->AddTabContents(new_contents, disposition, initial_pos, user_gesture); | 579 browser->AddTabContents(new_contents, disposition, initial_pos, user_gesture); |
580 } | 580 } |
OLD | NEW |