OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "apps/app_load_service.h" | 7 #include "apps/app_load_service.h" |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 it != contents_map_.end(); ++it) { | 760 it != contents_map_.end(); ++it) { |
761 if (contents == it->second.contents) | 761 if (contents == it->second.contents) |
762 return it->first; | 762 return it->first; |
763 } | 763 } |
764 return base::EmptyString16(); | 764 return base::EmptyString16(); |
765 } | 765 } |
766 | 766 |
767 void BackgroundContentsService::AddWebContents( | 767 void BackgroundContentsService::AddWebContents( |
768 WebContents* new_contents, | 768 WebContents* new_contents, |
769 WindowOpenDisposition disposition, | 769 WindowOpenDisposition disposition, |
770 const gfx::Rect& initial_pos, | 770 const gfx::Rect& initial_rect, |
771 bool user_gesture, | 771 bool user_gesture, |
772 bool* was_blocked) { | 772 bool* was_blocked) { |
773 Browser* browser = chrome::FindLastActiveWithProfile( | 773 Browser* browser = chrome::FindLastActiveWithProfile( |
774 Profile::FromBrowserContext(new_contents->GetBrowserContext()), | 774 Profile::FromBrowserContext(new_contents->GetBrowserContext()), |
775 chrome::GetActiveDesktop()); | 775 chrome::GetActiveDesktop()); |
776 if (browser) { | 776 if (browser) { |
777 chrome::AddWebContents(browser, NULL, new_contents, disposition, | 777 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
778 initial_pos, user_gesture, was_blocked); | 778 initial_rect, user_gesture, was_blocked); |
779 } | 779 } |
780 } | 780 } |
OLD | NEW |