| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/permissions/api_permission.h" | 5 #include "extensions/common/permissions/api_permission.h" |
| 6 | 6 |
| 7 #include "ui/base/l10n/l10n_util.h" | 7 #include "ui/base/l10n/l10n_util.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 virtual bool Equal(const APIPermission* rhs) const OVERRIDE { | 44 virtual bool Equal(const APIPermission* rhs) const OVERRIDE { |
| 45 if (this != rhs) | 45 if (this != rhs) |
| 46 CHECK_EQ(info(), rhs->info()); | 46 CHECK_EQ(info(), rhs->info()); |
| 47 return true; | 47 return true; |
| 48 } | 48 } |
| 49 | 49 |
| 50 virtual bool FromValue( | 50 virtual bool FromValue( |
| 51 const base::Value* value, | 51 const base::Value* value, |
| 52 std::string* /*error*/, | 52 std::string* /*error*/, |
| 53 std::vector<std::string>* /*unhandled_permissions*/) OVERRIDE { | 53 std::vector<std::string>* /*unhandled_permissions*/) OVERRIDE { |
| 54 return (value == NULL); | 54 return (value == nullptr); |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual scoped_ptr<base::Value> ToValue() const OVERRIDE { | 57 virtual scoped_ptr<base::Value> ToValue() const OVERRIDE { |
| 58 return scoped_ptr<base::Value>(); | 58 return scoped_ptr<base::Value>(); |
| 59 } | 59 } |
| 60 | 60 |
| 61 virtual APIPermission* Clone() const OVERRIDE { | 61 virtual APIPermission* Clone() const OVERRIDE { |
| 62 return new SimpleAPIPermission(info()); | 62 return new SimpleAPIPermission(info()); |
| 63 } | 63 } |
| 64 | 64 |
| 65 virtual APIPermission* Diff(const APIPermission* rhs) const OVERRIDE { | 65 virtual APIPermission* Diff(const APIPermission* rhs) const OVERRIDE { |
| 66 CHECK_EQ(info(), rhs->info()); | 66 CHECK_EQ(info(), rhs->info()); |
| 67 return NULL; | 67 return nullptr; |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual APIPermission* Union(const APIPermission* rhs) const OVERRIDE { | 70 virtual APIPermission* Union(const APIPermission* rhs) const OVERRIDE { |
| 71 CHECK_EQ(info(), rhs->info()); | 71 CHECK_EQ(info(), rhs->info()); |
| 72 return new SimpleAPIPermission(info()); | 72 return new SimpleAPIPermission(info()); |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual APIPermission* Intersect(const APIPermission* rhs) const OVERRIDE { | 75 virtual APIPermission* Intersect(const APIPermission* rhs) const OVERRIDE { |
| 76 CHECK_EQ(info(), rhs->info()); | 76 CHECK_EQ(info(), rhs->info()); |
| 77 return new SimpleAPIPermission(info()); | 77 return new SimpleAPIPermission(info()); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 return api_permission_constructor_ ? | 128 return api_permission_constructor_ ? |
| 129 api_permission_constructor_(this) : new SimpleAPIPermission(this); | 129 api_permission_constructor_(this) : new SimpleAPIPermission(this); |
| 130 } | 130 } |
| 131 | 131 |
| 132 PermissionMessage APIPermissionInfo::GetMessage_() const { | 132 PermissionMessage APIPermissionInfo::GetMessage_() const { |
| 133 return PermissionMessage( | 133 return PermissionMessage( |
| 134 message_id_, l10n_util::GetStringUTF16(l10n_message_id_)); | 134 message_id_, l10n_util::GetStringUTF16(l10n_message_id_)); |
| 135 } | 135 } |
| 136 | 136 |
| 137 } // namespace extensions | 137 } // namespace extensions |
| OLD | NEW |