| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef EXTENSIONS_COMMON_ALIAS_H_ |
| 6 #define EXTENSIONS_COMMON_ALIAS_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 namespace extensions { |
| 11 |
| 12 // Information about an alias. |
| 13 // Main usage: describing aliases for extension features (extension permissions, |
| 14 // APIs), which is useful for ensuring backward-compatibility of extension |
| 15 // features when they get renamed. Old feature name can be defined as an alias |
| 16 // for the new feature name - this would ensure that the extensions using the |
| 17 // old feature name don't break. |
| 18 class Alias { |
| 19 public: |
| 20 // |name|: The alias name. |
| 21 // |real_name|: The real name behind alias. |
| 22 Alias(const char* const name, const char* const real_name) |
| 23 : name_(name), real_name_(real_name) {} |
| 24 ~Alias() {} |
| 25 |
| 26 const std::string& name() const { return name_; } |
| 27 |
| 28 const std::string& real_name() const { return real_name_; } |
| 29 |
| 30 private: |
| 31 // The alias name. |
| 32 std::string name_; |
| 33 |
| 34 // The real name behind the alias. |
| 35 std::string real_name_; |
| 36 }; |
| 37 |
| 38 } // namespace extensions |
| 39 |
| 40 #endif // EXTENSIONS_COMMON_ALIAS_H_ |
| OLD | NEW |