OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/common/features/simple_feature.h" | 5 #include "extensions/common/features/simple_feature.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 case Manifest::TYPE_LEGACY_PACKAGED_APP: | 66 case Manifest::TYPE_LEGACY_PACKAGED_APP: |
67 return "legacy packaged app"; | 67 return "legacy packaged app"; |
68 case Manifest::TYPE_PLATFORM_APP: | 68 case Manifest::TYPE_PLATFORM_APP: |
69 return "packaged app"; | 69 return "packaged app"; |
70 case Manifest::TYPE_THEME: | 70 case Manifest::TYPE_THEME: |
71 return "theme"; | 71 return "theme"; |
72 case Manifest::TYPE_USER_SCRIPT: | 72 case Manifest::TYPE_USER_SCRIPT: |
73 return "user script"; | 73 return "user script"; |
74 case Manifest::TYPE_SHARED_MODULE: | 74 case Manifest::TYPE_SHARED_MODULE: |
75 return "shared module"; | 75 return "shared module"; |
76 case Manifest::NUM_LOAD_TYPES: | |
77 NOTREACHED(); | |
78 } | 76 } |
79 NOTREACHED(); | 77 NOTREACHED(); |
80 return ""; | 78 return ""; |
81 } | 79 } |
82 | 80 |
83 // Gets a human-readable name for the given context type, suitable for giving | 81 // Gets a human-readable name for the given context type, suitable for giving |
84 // to developers in an error message. | 82 // to developers in an error message. |
85 std::string GetDisplayName(Feature::Context context) { | 83 std::string GetDisplayName(Feature::Context context) { |
86 switch (context) { | 84 switch (context) { |
87 case Feature::UNSPECIFIED_CONTEXT: | 85 case Feature::UNSPECIFIED_CONTEXT: |
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
607 // "matches" from say "blessed_extension" then they can use complex features. | 605 // "matches" from say "blessed_extension" then they can use complex features. |
608 if ((context == WEB_PAGE_CONTEXT || context == WEBUI_CONTEXT) && | 606 if ((context == WEB_PAGE_CONTEXT || context == WEBUI_CONTEXT) && |
609 !matches_.MatchesURL(url)) { | 607 !matches_.MatchesURL(url)) { |
610 return CreateAvailability(INVALID_URL, url); | 608 return CreateAvailability(INVALID_URL, url); |
611 } | 609 } |
612 | 610 |
613 return CreateAvailability(IS_AVAILABLE); | 611 return CreateAvailability(IS_AVAILABLE); |
614 } | 612 } |
615 | 613 |
616 } // namespace extensions | 614 } // namespace extensions |
OLD | NEW |