| 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/browser/extensions/api/autotest_private/autotest_private_api.h" | 5 #include "chrome/browser/extensions/api/autotest_private/autotest_private_api.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_action_manager.h" | 9 #include "chrome/browser/extensions/extension_action_manager.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "chromeos/dbus/dbus_thread_manager.h" | 27 #include "chromeos/dbus/dbus_thread_manager.h" |
| 28 #include "chromeos/dbus/session_manager_client.h" | 28 #include "chromeos/dbus/session_manager_client.h" |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 namespace extensions { | 31 namespace extensions { |
| 32 namespace { | 32 namespace { |
| 33 | 33 |
| 34 base::ListValue* GetHostPermissions(const Extension* ext, bool effective_perm) { | 34 base::ListValue* GetHostPermissions(const Extension* ext, bool effective_perm) { |
| 35 extensions::URLPatternSet pattern_set; | 35 extensions::URLPatternSet pattern_set; |
| 36 if (effective_perm) { | 36 if (effective_perm) { |
| 37 pattern_set = | 37 pattern_set = extensions::PermissionsData::ForExtension(ext) |
| 38 extensions::PermissionsData::GetEffectiveHostPermissions(ext); | 38 ->GetEffectiveHostPermissions(); |
| 39 } else { | 39 } else { |
| 40 pattern_set = ext->GetActivePermissions()->explicit_hosts(); | 40 pattern_set = ext->GetActivePermissions()->explicit_hosts(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 base::ListValue* permissions = new base::ListValue; | 43 base::ListValue* permissions = new base::ListValue; |
| 44 for (extensions::URLPatternSet::const_iterator perm = pattern_set.begin(); | 44 for (extensions::URLPatternSet::const_iterator perm = pattern_set.begin(); |
| 45 perm != pattern_set.end(); ++perm) { | 45 perm != pattern_set.end(); ++perm) { |
| 46 permissions->Append(new base::StringValue(perm->GetAsString())); | 46 permissions->Append(new base::StringValue(perm->GetAsString())); |
| 47 } | 47 } |
| 48 | 48 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 return new AutotestPrivateAPI(); | 241 return new AutotestPrivateAPI(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) { | 244 AutotestPrivateAPI::AutotestPrivateAPI() : test_mode_(false) { |
| 245 } | 245 } |
| 246 | 246 |
| 247 AutotestPrivateAPI::~AutotestPrivateAPI() { | 247 AutotestPrivateAPI::~AutotestPrivateAPI() { |
| 248 } | 248 } |
| 249 | 249 |
| 250 } // namespace extensions | 250 } // namespace extensions |
| OLD | NEW |