| 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/extensions/schema_generated_bindings.h" | 5 #include "chrome/renderer/extensions/schema_generated_bindings.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // however it does not play correctly with the "IsTestExtensionId" checks. | 82 // however it does not play correctly with the "IsTestExtensionId" checks. |
| 83 // We need to remove that first. | 83 // We need to remove that first. |
| 84 scoped_ptr<std::set<std::string> > apis; | 84 scoped_ptr<std::set<std::string> > apis; |
| 85 | 85 |
| 86 const std::string& extension_id = v8_context->extension_id(); | 86 const std::string& extension_id = v8_context->extension_id(); |
| 87 if (extension_dispatcher()->IsTestExtensionId(extension_id)) { | 87 if (extension_dispatcher()->IsTestExtensionId(extension_id)) { |
| 88 apis.reset(new std::set<std::string>()); | 88 apis.reset(new std::set<std::string>()); |
| 89 // The minimal set of APIs that tests need. | 89 // The minimal set of APIs that tests need. |
| 90 apis->insert("extension"); | 90 apis->insert("extension"); |
| 91 } else { | 91 } else { |
| 92 apis = ExtensionAPI::GetSharedInstance()->GetAPIsForContext( | 92 apis = ExtensionAPI::GetInstance()->GetAPIsForContext( |
| 93 v8_context->context_type(), | 93 v8_context->context_type(), |
| 94 extension_dispatcher()->extensions()->GetByID(extension_id), | 94 extension_dispatcher()->extensions()->GetByID(extension_id), |
| 95 UserScriptSlave::GetDataSourceURLForFrame(v8_context->web_frame())); | 95 UserScriptSlave::GetDataSourceURLForFrame(v8_context->web_frame())); |
| 96 } | 96 } |
| 97 | 97 |
| 98 return extension_dispatcher()->v8_schema_registry()->GetSchemas(*apis); | 98 return extension_dispatcher()->v8_schema_registry()->GetSchemas(*apis); |
| 99 } | 99 } |
| 100 | 100 |
| 101 v8::Handle<v8::Value> SchemaGeneratedBindings::GetNextRequestId( | 101 v8::Handle<v8::Value> SchemaGeneratedBindings::GetNextRequestId( |
| 102 const v8::Arguments& args) { | 102 const v8::Arguments& args) { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 details->Get(v8::String::New("tabId"))->Int32Value()); | 198 details->Get(v8::String::New("tabId"))->Int32Value()); |
| 199 } | 199 } |
| 200 | 200 |
| 201 ListValue list_value; | 201 ListValue list_value; |
| 202 list_value.Append(dict); | 202 list_value.Append(dict); |
| 203 | 203 |
| 204 return StartRequestCommon(args, &list_value); | 204 return StartRequestCommon(args, &list_value); |
| 205 } | 205 } |
| 206 | 206 |
| 207 } // namespace extensions | 207 } // namespace extensions |
| OLD | NEW |