Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(776)

Side by Side Diff: chrome/renderer/extensions/dispatcher.cc

Issue 14494013: Allow API functions and events to have entries in _api_features.json (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698