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/common/extensions/permissions/api_permission.h" | 5 #include "chrome/common/extensions/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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 return true; | 48 return true; |
49 } | 49 } |
50 | 50 |
51 virtual bool FromValue(const base::Value* value) OVERRIDE { | 51 virtual bool FromValue(const base::Value* value) OVERRIDE { |
52 if (value) | 52 if (value) |
53 return false; | 53 return false; |
54 return true; | 54 return true; |
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>(NULL); | 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(info() == rhs->info()); | 66 CHECK(info() == rhs->info()); |
67 return NULL; | 67 return NULL; |
68 } | 68 } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 return api_permission_constructor_ ? | 138 return api_permission_constructor_ ? |
139 api_permission_constructor_(this) : new SimpleAPIPermission(this); | 139 api_permission_constructor_(this) : new SimpleAPIPermission(this); |
140 } | 140 } |
141 | 141 |
142 PermissionMessage APIPermissionInfo::GetMessage_() const { | 142 PermissionMessage APIPermissionInfo::GetMessage_() const { |
143 return PermissionMessage( | 143 return PermissionMessage( |
144 message_id_, l10n_util::GetStringUTF16(l10n_message_id_)); | 144 message_id_, l10n_util::GetStringUTF16(l10n_message_id_)); |
145 } | 145 } |
146 | 146 |
147 } // namespace extensions | 147 } // namespace extensions |
OLD | NEW |