| 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 "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/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 424 LoadBackgroundContentsFromDictionary(profile, extension_id, contents); | 424 LoadBackgroundContentsFromDictionary(profile, extension_id, contents); |
| 425 } | 425 } |
| 426 | 426 |
| 427 void BackgroundContentsService::LoadBackgroundContentsFromDictionary( | 427 void BackgroundContentsService::LoadBackgroundContentsFromDictionary( |
| 428 Profile* profile, | 428 Profile* profile, |
| 429 const std::string& extension_id, | 429 const std::string& extension_id, |
| 430 const DictionaryValue* contents) { | 430 const DictionaryValue* contents) { |
| 431 ExtensionService* extensions_service = profile->GetExtensionService(); | 431 ExtensionService* extensions_service = profile->GetExtensionService(); |
| 432 DCHECK(extensions_service); | 432 DCHECK(extensions_service); |
| 433 | 433 |
| 434 DictionaryValue* dict; | 434 const DictionaryValue* dict; |
| 435 if (!contents->GetDictionaryWithoutPathExpansion(extension_id, &dict) || | 435 if (!contents->GetDictionaryWithoutPathExpansion(extension_id, &dict) || |
| 436 dict == NULL) | 436 dict == NULL) |
| 437 return; | 437 return; |
| 438 | 438 |
| 439 string16 frame_name; | 439 string16 frame_name; |
| 440 std::string url; | 440 std::string url; |
| 441 dict->GetString(kUrlKey, &url); | 441 dict->GetString(kUrlKey, &url); |
| 442 dict->GetString(kFrameNameKey, &frame_name); | 442 dict->GetString(kFrameNameKey, &frame_name); |
| 443 LoadBackgroundContents(profile, | 443 LoadBackgroundContents(profile, |
| 444 GURL(url), | 444 GURL(url), |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 WindowOpenDisposition disposition, | 613 WindowOpenDisposition disposition, |
| 614 const gfx::Rect& initial_pos, | 614 const gfx::Rect& initial_pos, |
| 615 bool user_gesture) { | 615 bool user_gesture) { |
| 616 Browser* browser = browser::FindLastActiveWithProfile( | 616 Browser* browser = browser::FindLastActiveWithProfile( |
| 617 Profile::FromBrowserContext(new_contents->GetBrowserContext())); | 617 Profile::FromBrowserContext(new_contents->GetBrowserContext())); |
| 618 if (browser) { | 618 if (browser) { |
| 619 chrome::AddWebContents(browser, NULL, new_contents, disposition, | 619 chrome::AddWebContents(browser, NULL, new_contents, disposition, |
| 620 initial_pos, user_gesture); | 620 initial_pos, user_gesture); |
| 621 } | 621 } |
| 622 } | 622 } |
| OLD | NEW |