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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 dict->GetString(kUrlKey, &url); | 411 dict->GetString(kUrlKey, &url); |
412 dict->GetString(kFrameNameKey, &frame_name); | 412 dict->GetString(kFrameNameKey, &frame_name); |
413 LoadBackgroundContents(profile, | 413 LoadBackgroundContents(profile, |
414 GURL(url), | 414 GURL(url), |
415 frame_name, | 415 frame_name, |
416 UTF8ToUTF16(extension_id)); | 416 UTF8ToUTF16(extension_id)); |
417 } | 417 } |
418 | 418 |
419 void BackgroundContentsService::LoadBackgroundContentsFromManifests( | 419 void BackgroundContentsService::LoadBackgroundContentsFromManifests( |
420 Profile* profile) { | 420 Profile* profile) { |
421 const ExtensionSet* extensions = | 421 const ExtensionList* extensions = |
422 profile->GetExtensionService()->extensions(); | 422 profile->GetExtensionService()->extensions(); |
423 ExtensionSet::const_iterator iter = extensions->begin(); | 423 ExtensionList::const_iterator iter = extensions->begin(); |
424 for (; iter != extensions->end(); ++iter) { | 424 for (; iter != extensions->end(); ++iter) { |
425 const Extension* extension = *iter; | 425 const Extension* extension = *iter; |
426 if (extension->is_hosted_app() && | 426 if (extension->is_hosted_app() && |
427 extension->background_url().is_valid()) { | 427 extension->background_url().is_valid()) { |
428 LoadBackgroundContents(profile, | 428 LoadBackgroundContents(profile, |
429 extension->background_url(), | 429 extension->background_url(), |
430 ASCIIToUTF16("background"), | 430 ASCIIToUTF16("background"), |
431 UTF8ToUTF16(extension->id())); | 431 UTF8ToUTF16(extension->id())); |
432 } | 432 } |
433 } | 433 } |
(...skipping 138 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 |