Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(989)

Side by Side Diff: extensions/common/permissions/api_permission.cc

Issue 622343002: replace OVERRIDE and FINAL with override and final in extensions/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
11 using extensions::APIPermission; 11 using extensions::APIPermission;
12 using extensions::APIPermissionInfo; 12 using extensions::APIPermissionInfo;
13 using extensions::PermissionMessage; 13 using extensions::PermissionMessage;
14 using extensions::PermissionMessages; 14 using extensions::PermissionMessages;
15 15
16 class SimpleAPIPermission : public APIPermission { 16 class SimpleAPIPermission : public APIPermission {
17 public: 17 public:
18 explicit SimpleAPIPermission(const APIPermissionInfo* permission) 18 explicit SimpleAPIPermission(const APIPermissionInfo* permission)
19 : APIPermission(permission) { } 19 : APIPermission(permission) { }
20 20
21 virtual ~SimpleAPIPermission() { } 21 virtual ~SimpleAPIPermission() { }
22 22
23 virtual bool HasMessages() const OVERRIDE { 23 virtual bool HasMessages() const override {
24 return info()->message_id() > PermissionMessage::kNone; 24 return info()->message_id() > PermissionMessage::kNone;
25 } 25 }
26 26
27 virtual PermissionMessages GetMessages() const OVERRIDE { 27 virtual PermissionMessages GetMessages() const override {
28 DCHECK(HasMessages()); 28 DCHECK(HasMessages());
29 PermissionMessages result; 29 PermissionMessages result;
30 result.push_back(GetMessage_()); 30 result.push_back(GetMessage_());
31 return result; 31 return result;
32 } 32 }
33 33
34 virtual bool Check( 34 virtual bool Check(
35 const APIPermission::CheckParam* param) const OVERRIDE { 35 const APIPermission::CheckParam* param) const override {
36 return !param; 36 return !param;
37 } 37 }
38 38
39 virtual bool Contains(const APIPermission* rhs) const OVERRIDE { 39 virtual bool Contains(const APIPermission* rhs) const override {
40 CHECK_EQ(info(), rhs->info()); 40 CHECK_EQ(info(), rhs->info());
41 return true; 41 return true;
42 } 42 }
43 43
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 == NULL);
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 NULL;
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());
78 } 78 }
79 79
80 virtual void Write(IPC::Message* m) const OVERRIDE { } 80 virtual void Write(IPC::Message* m) const override { }
81 81
82 virtual bool Read(const IPC::Message* m, PickleIterator* iter) OVERRIDE { 82 virtual bool Read(const IPC::Message* m, PickleIterator* iter) override {
83 return true; 83 return true;
84 } 84 }
85 85
86 virtual void Log(std::string* log) const OVERRIDE { } 86 virtual void Log(std::string* log) const override { }
87 }; 87 };
88 88
89 } // namespace 89 } // namespace
90 90
91 namespace extensions { 91 namespace extensions {
92 92
93 APIPermission::APIPermission(const APIPermissionInfo* info) 93 APIPermission::APIPermission(const APIPermissionInfo* info)
94 : info_(info) { 94 : info_(info) {
95 DCHECK(info_); 95 DCHECK(info_);
96 } 96 }
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « extensions/common/manifest_handlers/webview_info.h ('k') | extensions/common/permissions/extensions_api_permissions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698