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/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
743 it != apis.end(); ++it) { | 743 it != apis.end(); ++it) { |
744 const std::string& api_name = *it; | 744 const std::string& api_name = *it; |
745 Feature* feature = api_feature_provider->GetFeature(api_name); | 745 Feature* feature = api_feature_provider->GetFeature(api_name); |
746 DCHECK(feature); | 746 DCHECK(feature); |
747 | 747 |
748 // Internal APIs are included via require(api_name) from internal code | 748 // Internal APIs are included via require(api_name) from internal code |
749 // rather than chrome[api_name]. | 749 // rather than chrome[api_name]. |
750 if (feature->IsInternal()) | 750 if (feature->IsInternal()) |
751 continue; | 751 continue; |
752 | 752 |
753 // If this API name has parent features, then this must be a function or | 753 // If this API has a parent feature (and isn't marked 'noparent'), |
754 // event, so we should not register. | 754 // then this must be a function or event, so we should not register. |
755 bool parent_feature_available = false; | 755 if (api_feature_provider->GetParent(feature) != NULL) |
756 for (Feature* parent = api_feature_provider->GetParent(feature); | |
757 parent != NULL; parent = api_feature_provider->GetParent(parent)) { | |
758 if (context->IsAnyFeatureAvailableToContext(*parent)) { | |
759 parent_feature_available = true; | |
760 break; | |
761 } | |
762 } | |
763 if (parent_feature_available) | |
764 continue; | 756 continue; |
765 | 757 |
766 if (context->IsAnyFeatureAvailableToContext(*feature)) | 758 if (context->IsAnyFeatureAvailableToContext(*feature)) |
767 RegisterBinding(api_name, context); | 759 RegisterBinding(api_name, context); |
768 } | 760 } |
769 break; | 761 break; |
770 } | 762 } |
771 } | 763 } |
772 } | 764 } |
773 | 765 |
(...skipping 882 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1656 RenderView* background_view = | 1648 RenderView* background_view = |
1657 ExtensionHelper::GetBackgroundPage(extension_id); | 1649 ExtensionHelper::GetBackgroundPage(extension_id); |
1658 if (background_view) { | 1650 if (background_view) { |
1659 background_view->Send(new ExtensionHostMsg_EventAck( | 1651 background_view->Send(new ExtensionHostMsg_EventAck( |
1660 background_view->GetRoutingID())); | 1652 background_view->GetRoutingID())); |
1661 } | 1653 } |
1662 } | 1654 } |
1663 } | 1655 } |
1664 | 1656 |
1665 } // namespace extensions | 1657 } // namespace extensions |
OLD | NEW |