| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/extensions/chrome_content_browser_client_extensions_par
t.h" | 5 #include "chrome/browser/extensions/chrome_content_browser_client_extensions_par
t.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 new_extension->id(), site_instance->GetProcess()->GetID())) | 449 new_extension->id(), site_instance->GetProcess()->GetID())) |
| 450 return true; | 450 return true; |
| 451 | 451 |
| 452 // Otherwise, swap BrowsingInstances if current_extension and new_extension | 452 // Otherwise, swap BrowsingInstances if current_extension and new_extension |
| 453 // differ. | 453 // differ. |
| 454 return current_extension != new_extension; | 454 return current_extension != new_extension; |
| 455 } | 455 } |
| 456 | 456 |
| 457 // static | 457 // static |
| 458 bool ChromeContentBrowserClientExtensionsPart::ShouldSwapProcessesForRedirect( | 458 bool ChromeContentBrowserClientExtensionsPart::ShouldSwapProcessesForRedirect( |
| 459 content::BrowserContext* browser_context, | 459 content::ResourceContext* resource_context, |
| 460 const GURL& current_url, | 460 const GURL& current_url, |
| 461 const GURL& new_url) { | 461 const GURL& new_url) { |
| 462 ProfileIOData* io_data = ProfileIOData::FromResourceContext(resource_context); |
| 462 return CrossesExtensionProcessBoundary( | 463 return CrossesExtensionProcessBoundary( |
| 463 ExtensionRegistry::Get(browser_context)->enabled_extensions(), | 464 io_data->GetExtensionInfoMap()->extensions(), |
| 464 current_url, new_url, false); | 465 current_url, new_url, false); |
| 465 } | 466 } |
| 466 | 467 |
| 467 // static | 468 // static |
| 468 bool ChromeContentBrowserClientExtensionsPart::AllowServiceWorker( | 469 bool ChromeContentBrowserClientExtensionsPart::AllowServiceWorker( |
| 469 const GURL& scope, | 470 const GURL& scope, |
| 470 const GURL& first_party_url, | 471 const GURL& first_party_url, |
| 471 content::ResourceContext* context, | 472 content::ResourceContext* context, |
| 472 int render_process_id, | 473 int render_process_id, |
| 473 int render_frame_id) { | 474 int render_frame_id) { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 685 } | 686 } |
| 686 } | 687 } |
| 687 } | 688 } |
| 688 | 689 |
| 689 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { | 690 void ChromeContentBrowserClientExtensionsPart::ResourceDispatcherHostCreated() { |
| 690 content::ResourceDispatcherHost::Get()->RegisterInterceptor( | 691 content::ResourceDispatcherHost::Get()->RegisterInterceptor( |
| 691 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); | 692 "Origin", kExtensionScheme, base::Bind(&OnHttpHeaderReceived)); |
| 692 } | 693 } |
| 693 | 694 |
| 694 } // namespace extensions | 695 } // namespace extensions |
| OLD | NEW |