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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
6 #include "base/json/json_file_value_serializer.h" | 6 #include "base/json/json_file_value_serializer.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 } | 122 } |
123 | 123 |
124 bool received_notification() const { return received_notification_; } | 124 bool received_notification() const { return received_notification_; } |
125 const Extension* extension() const { return extension_.get(); } | 125 const Extension* extension() const { return extension_.get(); } |
126 const PermissionSet* permissions() const { return permissions_.get(); } | 126 const PermissionSet* permissions() const { return permissions_.get(); } |
127 UpdatedExtensionPermissionsInfo::Reason reason() const { return reason_; } | 127 UpdatedExtensionPermissionsInfo::Reason reason() const { return reason_; } |
128 | 128 |
129 private: | 129 private: |
130 virtual void Observe(int type, | 130 virtual void Observe(int type, |
131 const content::NotificationSource& source, | 131 const content::NotificationSource& source, |
132 const content::NotificationDetails& details) OVERRIDE { | 132 const content::NotificationDetails& details) override { |
133 received_notification_ = true; | 133 received_notification_ = true; |
134 UpdatedExtensionPermissionsInfo* info = | 134 UpdatedExtensionPermissionsInfo* info = |
135 content::Details<UpdatedExtensionPermissionsInfo>(details).ptr(); | 135 content::Details<UpdatedExtensionPermissionsInfo>(details).ptr(); |
136 | 136 |
137 extension_ = info->extension; | 137 extension_ = info->extension; |
138 permissions_ = info->permissions; | 138 permissions_ = info->permissions; |
139 reason_ = info->reason; | 139 reason_ = info->reason; |
140 | 140 |
141 if (waiting_) { | 141 if (waiting_) { |
142 waiting_ = false; | 142 waiting_ = false; |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 EXPECT_TRUE(SetsAreEqual( | 394 EXPECT_TRUE(SetsAreEqual( |
395 permissions_data->active_permissions()->explicit_hosts().patterns(), | 395 permissions_data->active_permissions()->explicit_hosts().patterns(), |
396 all_patterns)); | 396 all_patterns)); |
397 EXPECT_TRUE(permissions_data->withheld_permissions() | 397 EXPECT_TRUE(permissions_data->withheld_permissions() |
398 ->explicit_hosts() | 398 ->explicit_hosts() |
399 .patterns() | 399 .patterns() |
400 .empty()); | 400 .empty()); |
401 } | 401 } |
402 | 402 |
403 } // namespace extensions | 403 } // namespace extensions |
OLD | NEW |