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/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 site_instance->GetSite())); | 637 site_instance->GetSite())); |
638 if (!extension) | 638 if (!extension) |
639 return; | 639 return; |
640 | 640 |
641 service->process_map()->Insert(extension->id(), | 641 service->process_map()->Insert(extension->id(), |
642 site_instance->GetProcess()->GetID(), | 642 site_instance->GetProcess()->GetID(), |
643 site_instance->GetId()); | 643 site_instance->GetId()); |
644 BrowserThread::PostTask( | 644 BrowserThread::PostTask( |
645 BrowserThread::IO, FROM_HERE, | 645 BrowserThread::IO, FROM_HERE, |
646 base::Bind(&ExtensionInfoMap::RegisterExtensionProcess, | 646 base::Bind(&ExtensionInfoMap::RegisterExtensionProcess, |
647 ExtensionSystem::Get(profile)->info_map(), | 647 extensions::ExtensionSystem::Get(profile)->info_map(), |
648 extension->id(), | 648 extension->id(), |
649 site_instance->GetProcess()->GetID(), | 649 site_instance->GetProcess()->GetID(), |
650 site_instance->GetId())); | 650 site_instance->GetId())); |
651 } | 651 } |
652 | 652 |
653 void ChromeContentBrowserClient::SiteInstanceDeleting( | 653 void ChromeContentBrowserClient::SiteInstanceDeleting( |
654 SiteInstance* site_instance) { | 654 SiteInstance* site_instance) { |
655 if (!site_instance->HasProcess()) | 655 if (!site_instance->HasProcess()) |
656 return; | 656 return; |
657 | 657 |
658 Profile* profile = Profile::FromBrowserContext( | 658 Profile* profile = Profile::FromBrowserContext( |
659 site_instance->GetBrowserContext()); | 659 site_instance->GetBrowserContext()); |
660 ExtensionService* service = profile->GetExtensionService(); | 660 ExtensionService* service = profile->GetExtensionService(); |
661 if (!service) | 661 if (!service) |
662 return; | 662 return; |
663 | 663 |
664 const Extension* extension = | 664 const Extension* extension = |
665 service->extensions()->GetExtensionOrAppByURL( | 665 service->extensions()->GetExtensionOrAppByURL( |
666 ExtensionURLInfo(site_instance->GetSite())); | 666 ExtensionURLInfo(site_instance->GetSite())); |
667 if (!extension) | 667 if (!extension) |
668 return; | 668 return; |
669 | 669 |
670 service->process_map()->Remove(extension->id(), | 670 service->process_map()->Remove(extension->id(), |
671 site_instance->GetProcess()->GetID(), | 671 site_instance->GetProcess()->GetID(), |
672 site_instance->GetId()); | 672 site_instance->GetId()); |
673 BrowserThread::PostTask( | 673 BrowserThread::PostTask( |
674 BrowserThread::IO, FROM_HERE, | 674 BrowserThread::IO, FROM_HERE, |
675 base::Bind(&ExtensionInfoMap::UnregisterExtensionProcess, | 675 base::Bind(&ExtensionInfoMap::UnregisterExtensionProcess, |
676 ExtensionSystem::Get(profile)->info_map(), | 676 extensions::ExtensionSystem::Get(profile)->info_map(), |
677 extension->id(), | 677 extension->id(), |
678 site_instance->GetProcess()->GetID(), | 678 site_instance->GetProcess()->GetID(), |
679 site_instance->GetId())); | 679 site_instance->GetId())); |
680 } | 680 } |
681 | 681 |
682 bool ChromeContentBrowserClient::ShouldSwapProcessesForNavigation( | 682 bool ChromeContentBrowserClient::ShouldSwapProcessesForNavigation( |
683 const GURL& current_url, | 683 const GURL& current_url, |
684 const GURL& new_url) { | 684 const GURL& new_url) { |
685 if (current_url.is_empty()) { | 685 if (current_url.is_empty()) { |
686 // Always choose a new process when navigating to extension URLs. The | 686 // Always choose a new process when navigating to extension URLs. The |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1647 io_thread_application_locale_ = locale; | 1647 io_thread_application_locale_ = locale; |
1648 } | 1648 } |
1649 | 1649 |
1650 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( | 1650 void ChromeContentBrowserClient::SetApplicationLocaleOnIOThread( |
1651 const std::string& locale) { | 1651 const std::string& locale) { |
1652 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 1652 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
1653 io_thread_application_locale_ = locale; | 1653 io_thread_application_locale_ = locale; |
1654 } | 1654 } |
1655 | 1655 |
1656 } // namespace chrome | 1656 } // namespace chrome |
OLD | NEW |