| 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/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/common/extensions/extension.h" | 8 #include "chrome/common/extensions/extension.h" |
| 9 #include "chrome/common/extensions/extension_builder.h" | 9 #include "chrome/common/extensions/extension_builder.h" |
| 10 #include "chrome/common/extensions/extension_manifest_constants.h" | 10 #include "chrome/common/extensions/extension_manifest_constants.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 manifest.Set(extension_manifest_keys::kWebURLs, url_list); | 89 manifest.Set(extension_manifest_keys::kWebURLs, url_list); |
| 90 manifest.SetString(extension_manifest_keys::kLaunchWebURL, app_url); | 90 manifest.SetString(extension_manifest_keys::kLaunchWebURL, app_url); |
| 91 } | 91 } |
| 92 std::string error; | 92 std::string error; |
| 93 return extensions::Extension::Create(base::FilePath(), location, manifest, | 93 return extensions::Extension::Create(base::FilePath(), location, manifest, |
| 94 flags, &error); | 94 flags, &error); |
| 95 } | 95 } |
| 96 | 96 |
| 97 scoped_refptr<const extensions::Extension> CreateExtension( | 97 scoped_refptr<const extensions::Extension> CreateExtension( |
| 98 bool is_unrestricted, bool is_from_webstore) { | 98 bool is_unrestricted, bool is_from_webstore) { |
| 99 return CreateTestExtension(is_unrestricted, is_from_webstore, kNotHostedApp, | 99 return CreateTestExtension( |
| 100 ""); | 100 is_unrestricted, is_from_webstore, kNotHostedApp, std::string()); |
| 101 } | 101 } |
| 102 | 102 |
| 103 scoped_refptr<const extensions::Extension> CreateHostedApp( | 103 scoped_refptr<const extensions::Extension> CreateHostedApp( |
| 104 bool is_unrestricted, bool is_from_webstore, const std::string& app_url) { | 104 bool is_unrestricted, bool is_from_webstore, const std::string& app_url) { |
| 105 return CreateTestExtension(is_unrestricted, is_from_webstore, kHostedApp, | 105 return CreateTestExtension(is_unrestricted, is_from_webstore, kHostedApp, |
| 106 app_url); | 106 app_url); |
| 107 } | 107 } |
| 108 | 108 |
| 109 TEST_F(ChromeContentRendererClientTest, NaClRestriction) { | 109 TEST_F(ChromeContentRendererClientTest, NaClRestriction) { |
| 110 // Unknown content types have no NaCl module. | 110 // Unknown content types have no NaCl module. |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 kRandomExtensionID + "/foo"))); | 336 kRandomExtensionID + "/foo"))); |
| 337 EXPECT_TRUE(client.IsRequestOSFileHandleAllowedForURL( | 337 EXPECT_TRUE(client.IsRequestOSFileHandleAllowedForURL( |
| 338 GURL("filesystem:http://127.0.0.1/foo"))); | 338 GURL("filesystem:http://127.0.0.1/foo"))); |
| 339 EXPECT_FALSE(client.IsRequestOSFileHandleAllowedForURL( | 339 EXPECT_FALSE(client.IsRequestOSFileHandleAllowedForURL( |
| 340 GURL("http://127.0.0.1/foo"))); | 340 GURL("http://127.0.0.1/foo"))); |
| 341 EXPECT_TRUE(client.IsRequestOSFileHandleAllowedForURL( | 341 EXPECT_TRUE(client.IsRequestOSFileHandleAllowedForURL( |
| 342 GURL("filesystem:http://192.168.0.1/foo"))); | 342 GURL("filesystem:http://192.168.0.1/foo"))); |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace chrome | 345 } // namespace chrome |
| OLD | NEW |