| 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/strings/utf_string_conversions.h" | 7 #include "base/strings/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" | |
| 11 #include "content/public/common/webplugininfo.h" | 10 #include "content/public/common/webplugininfo.h" |
| 11 #include "extensions/common/manifest_constants.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "third_party/WebKit/public/platform/WebString.h" | 13 #include "third_party/WebKit/public/platform/WebString.h" |
| 14 #include "third_party/WebKit/public/platform/WebVector.h" | 14 #include "third_party/WebKit/public/platform/WebVector.h" |
| 15 #include "third_party/WebKit/public/web/WebPluginParams.h" | 15 #include "third_party/WebKit/public/web/WebPluginParams.h" |
| 16 #include "url/gurl.h" | 16 #include "url/gurl.h" |
| 17 | 17 |
| 18 using WebKit::WebPluginParams; | 18 using WebKit::WebPluginParams; |
| 19 using WebKit::WebString; | 19 using WebKit::WebString; |
| 20 using WebKit::WebVector; | 20 using WebKit::WebVector; |
| 21 using chrome::ChromeContentRendererClient; | 21 using chrome::ChromeContentRendererClient; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 extensions::Extension::FROM_WEBSTORE: | 84 extensions::Extension::FROM_WEBSTORE: |
| 85 extensions::Extension::NO_FLAGS; | 85 extensions::Extension::NO_FLAGS; |
| 86 | 86 |
| 87 base::DictionaryValue manifest; | 87 base::DictionaryValue manifest; |
| 88 manifest.SetString("name", "NaCl Extension"); | 88 manifest.SetString("name", "NaCl Extension"); |
| 89 manifest.SetString("version", "1"); | 89 manifest.SetString("version", "1"); |
| 90 manifest.SetInteger("manifest_version", 2); | 90 manifest.SetInteger("manifest_version", 2); |
| 91 if (is_hosted_app) { | 91 if (is_hosted_app) { |
| 92 base::ListValue* url_list = new base::ListValue(); | 92 base::ListValue* url_list = new base::ListValue(); |
| 93 url_list->Append(base::Value::CreateStringValue(app_url)); | 93 url_list->Append(base::Value::CreateStringValue(app_url)); |
| 94 manifest.Set(extension_manifest_keys::kWebURLs, url_list); | 94 manifest.Set(extensions::manifest_keys::kWebURLs, url_list); |
| 95 manifest.SetString(extension_manifest_keys::kLaunchWebURL, app_url); | 95 manifest.SetString(extensions::manifest_keys::kLaunchWebURL, app_url); |
| 96 } | 96 } |
| 97 std::string error; | 97 std::string error; |
| 98 return extensions::Extension::Create(base::FilePath(), location, manifest, | 98 return extensions::Extension::Create(base::FilePath(), location, manifest, |
| 99 flags, &error); | 99 flags, &error); |
| 100 } | 100 } |
| 101 | 101 |
| 102 scoped_refptr<const extensions::Extension> CreateExtension( | 102 scoped_refptr<const extensions::Extension> CreateExtension( |
| 103 bool is_unrestricted, bool is_from_webstore) { | 103 bool is_unrestricted, bool is_from_webstore) { |
| 104 return CreateTestExtension( | 104 return CreateTestExtension( |
| 105 is_unrestricted, is_from_webstore, kNotHostedApp, std::string()); | 105 is_unrestricted, is_from_webstore, kNotHostedApp, std::string()); |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 GURL("http://example.evil.com/test.html"), | 336 GURL("http://example.evil.com/test.html"), |
| 337 kNaClRestricted, | 337 kNaClRestricted, |
| 338 CreateHostedApp(kExtensionRestricted, | 338 CreateHostedApp(kExtensionRestricted, |
| 339 kExtensionNotFromWebStore, | 339 kExtensionNotFromWebStore, |
| 340 "http://example.com/").get(), | 340 "http://example.com/").get(), |
| 341 ¶ms)); | 341 ¶ms)); |
| 342 } | 342 } |
| 343 } | 343 } |
| 344 | 344 |
| 345 } // namespace chrome | 345 } // namespace chrome |
| OLD | NEW |