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/extensions/extension_protocols.h" | 5 #include "chrome/browser/extensions/extension_protocols.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/base64.h" | 9 #include "base/base64.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
475 if ((extension->manifest_version() >= 2 || | 475 if ((extension->manifest_version() >= 2 || |
476 extensions::WebAccessibleResourcesInfo::HasWebAccessibleResources( | 476 extensions::WebAccessibleResourcesInfo::HasWebAccessibleResources( |
477 extension)) && | 477 extension)) && |
478 extensions::WebAccessibleResourcesInfo::IsResourceWebAccessible( | 478 extensions::WebAccessibleResourcesInfo::IsResourceWebAccessible( |
479 extension, resource_path)) | 479 extension, resource_path)) |
480 send_cors_header = true; | 480 send_cors_header = true; |
481 } | 481 } |
482 | 482 |
483 std::string path = request->url().path(); | 483 std::string path = request->url().path(); |
484 if (path.size() > 1 && | 484 if (path.size() > 1 && |
485 path.substr(1) == extension_filenames::kGeneratedBackgroundPageFilename) { | 485 path.substr(1) == extensions::kGeneratedBackgroundPageFilename) { |
486 return new GeneratedBackgroundPageJob( | 486 return new GeneratedBackgroundPageJob( |
487 request, network_delegate, extension, content_security_policy); | 487 request, network_delegate, extension, content_security_policy); |
488 } | 488 } |
489 | 489 |
490 base::FilePath resources_path; | 490 base::FilePath resources_path; |
491 base::FilePath relative_path; | 491 base::FilePath relative_path; |
492 // Try to load extension resources from chrome resource file if | 492 // Try to load extension resources from chrome resource file if |
493 // directory_path is a descendant of resources_path. resources_path | 493 // directory_path is a descendant of resources_path. resources_path |
494 // corresponds to src/chrome/browser/resources in source tree. | 494 // corresponds to src/chrome/browser/resources in source tree. |
495 if (PathService::Get(chrome::DIR_RESOURCES, &resources_path) && | 495 if (PathService::Get(chrome::DIR_RESOURCES, &resources_path) && |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 send_cors_header); | 562 send_cors_header); |
563 } | 563 } |
564 | 564 |
565 } // namespace | 565 } // namespace |
566 | 566 |
567 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler( | 567 net::URLRequestJobFactory::ProtocolHandler* CreateExtensionProtocolHandler( |
568 bool is_incognito, | 568 bool is_incognito, |
569 ExtensionInfoMap* extension_info_map) { | 569 ExtensionInfoMap* extension_info_map) { |
570 return new ExtensionProtocolHandler(is_incognito, extension_info_map); | 570 return new ExtensionProtocolHandler(is_incognito, extension_info_map); |
571 } | 571 } |
OLD | NEW |