| 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/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/alias.h" | 9 #include "base/debug/alias.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 } | 692 } |
| 693 | 693 |
| 694 void Dispatcher::RegisterSchemaGeneratedBindings( | 694 void Dispatcher::RegisterSchemaGeneratedBindings( |
| 695 ModuleSystem* module_system, | 695 ModuleSystem* module_system, |
| 696 ChromeV8Context* context) { | 696 ChromeV8Context* context) { |
| 697 std::set<std::string> apis = | 697 std::set<std::string> apis = |
| 698 ExtensionAPI::GetSharedInstance()->GetAllAPINames(); | 698 ExtensionAPI::GetSharedInstance()->GetAllAPINames(); |
| 699 for (std::set<std::string>::iterator it = apis.begin(); | 699 for (std::set<std::string>::iterator it = apis.begin(); |
| 700 it != apis.end(); ++it) { | 700 it != apis.end(); ++it) { |
| 701 const std::string& api_name = *it; | 701 const std::string& api_name = *it; |
| 702 if (!context->GetAvailabilityForContext(api_name).is_available()) | 702 if (!context->GetPossibleAvailabilityForContext(api_name)) |
| 703 continue; | 703 continue; |
| 704 | 704 |
| 705 Feature* feature = | 705 Feature* feature = |
| 706 BaseFeatureProvider::GetByName("api")->GetFeature(api_name); | 706 BaseFeatureProvider::GetByName("api")->GetFeature(api_name); |
| 707 if (feature && feature->IsInternal()) | 707 if (feature && feature->IsInternal()) |
| 708 continue; | 708 continue; |
| 709 | 709 |
| 710 std::vector<std::string> split; | 710 std::vector<std::string> split; |
| 711 base::SplitString(api_name, '.', &split); | 711 base::SplitString(api_name, '.', &split); |
| 712 | 712 |
| (...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1410 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); | 1410 std::string error_msg = base::StringPrintf(kMessage, function_name.c_str()); |
| 1411 v8::ThrowException( | 1411 v8::ThrowException( |
| 1412 v8::Exception::Error(v8::String::New(error_msg.c_str()))); | 1412 v8::Exception::Error(v8::String::New(error_msg.c_str()))); |
| 1413 return false; | 1413 return false; |
| 1414 } | 1414 } |
| 1415 | 1415 |
| 1416 return true; | 1416 return true; |
| 1417 } | 1417 } |
| 1418 | 1418 |
| 1419 } // namespace extensions | 1419 } // namespace extensions |
| OLD | NEW |