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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 frame_name, | 510 frame_name, |
511 UTF8ToUTF16(extension_id)); | 511 UTF8ToUTF16(extension_id)); |
512 } | 512 } |
513 | 513 |
514 void BackgroundContentsService::LoadBackgroundContentsFromManifests( | 514 void BackgroundContentsService::LoadBackgroundContentsFromManifests( |
515 Profile* profile) { | 515 Profile* profile) { |
516 const ExtensionSet* extensions = extensions::ExtensionSystem::Get(profile)-> | 516 const ExtensionSet* extensions = extensions::ExtensionSystem::Get(profile)-> |
517 extension_service()->extensions(); | 517 extension_service()->extensions(); |
518 ExtensionSet::const_iterator iter = extensions->begin(); | 518 ExtensionSet::const_iterator iter = extensions->begin(); |
519 for (; iter != extensions->end(); ++iter) { | 519 for (; iter != extensions->end(); ++iter) { |
520 const Extension* extension = *iter; | 520 const Extension* extension = iter->get(); |
521 if (extension->is_hosted_app() && | 521 if (extension->is_hosted_app() && |
522 BackgroundInfo::HasBackgroundPage(extension)) { | 522 BackgroundInfo::HasBackgroundPage(extension)) { |
523 LoadBackgroundContents(profile, | 523 LoadBackgroundContents(profile, |
524 BackgroundInfo::GetBackgroundURL(extension), | 524 BackgroundInfo::GetBackgroundURL(extension), |
525 ASCIIToUTF16("background"), | 525 ASCIIToUTF16("background"), |
526 UTF8ToUTF16(extension->id())); | 526 UTF8ToUTF16(extension->id())); |
527 } | 527 } |
528 } | 528 } |
529 } | 529 } |
530 | 530 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 bool user_gesture, | 681 bool user_gesture, |
682 bool* was_blocked) { | 682 bool* was_blocked) { |
683 Browser* browser = chrome::FindLastActiveWithProfile( | 683 Browser* browser = chrome::FindLastActiveWithProfile( |
684 Profile::FromBrowserContext(new_contents->GetBrowserContext()), | 684 Profile::FromBrowserContext(new_contents->GetBrowserContext()), |
685 chrome::GetActiveDesktop()); | 685 chrome::GetActiveDesktop()); |
686 if (browser) { | 686 if (browser) { |
687 chrome::AddWebContents(browser, NULL, new_contents, disposition, | 687 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
688 initial_pos, user_gesture, was_blocked); | 688 initial_pos, user_gesture, was_blocked); |
689 } | 689 } |
690 } | 690 } |
OLD | NEW |