| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/automation/testing_automation_provider.h" | 5 #include "chrome/browser/automation/testing_automation_provider.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 3997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4008 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); | 4008 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); |
| 4009 } | 4009 } |
| 4010 | 4010 |
| 4011 namespace { | 4011 namespace { |
| 4012 | 4012 |
| 4013 ListValue* GetHostPermissions(const Extension* ext, bool effective_perm) { | 4013 ListValue* GetHostPermissions(const Extension* ext, bool effective_perm) { |
| 4014 URLPatternList pattern_list; | 4014 URLPatternList pattern_list; |
| 4015 if (effective_perm) | 4015 if (effective_perm) |
| 4016 pattern_list = ext->GetEffectiveHostPermissions().patterns(); | 4016 pattern_list = ext->GetEffectiveHostPermissions().patterns(); |
| 4017 else | 4017 else |
| 4018 pattern_list = ext->host_permissions(); | 4018 pattern_list = ext->permission_set()->explicit_hosts().patterns(); |
| 4019 | 4019 |
| 4020 ListValue* permissions = new ListValue; | 4020 ListValue* permissions = new ListValue; |
| 4021 for (URLPatternList::const_iterator perm = pattern_list.begin(); | 4021 for (URLPatternList::const_iterator perm = pattern_list.begin(); |
| 4022 perm != pattern_list.end(); ++perm) { | 4022 perm != pattern_list.end(); ++perm) { |
| 4023 permissions->Append(new StringValue(perm->GetAsString())); | 4023 permissions->Append(new StringValue(perm->GetAsString())); |
| 4024 } | 4024 } |
| 4025 | 4025 |
| 4026 return permissions; | 4026 return permissions; |
| 4027 } | 4027 } |
| 4028 | 4028 |
| 4029 ListValue* GetAPIPermissions(const Extension* ext) { | 4029 ListValue* GetAPIPermissions(const Extension* ext) { |
| 4030 ListValue* permissions = new ListValue; | 4030 ListValue* permissions = new ListValue; |
| 4031 std::set<std::string> perm_list = ext->api_permissions(); | 4031 std::set<std::string> perm_list = ext->permission_set()->GetAPIsAsStrings(); |
| 4032 for (std::set<std::string>::const_iterator perm = perm_list.begin(); | 4032 for (std::set<std::string>::const_iterator perm = perm_list.begin(); |
| 4033 perm != perm_list.end(); ++perm) { | 4033 perm != perm_list.end(); ++perm) { |
| 4034 permissions->Append(new StringValue(perm->c_str())); | 4034 permissions->Append(new StringValue(perm->c_str())); |
| 4035 } | 4035 } |
| 4036 return permissions; | 4036 return permissions; |
| 4037 } | 4037 } |
| 4038 | 4038 |
| 4039 } // namespace | 4039 } // namespace |
| 4040 | 4040 |
| 4041 // Sample json input: { "command": "GetExtensionsInfo" } | 4041 // Sample json input: { "command": "GetExtensionsInfo" } |
| (...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5980 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 5980 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 5981 | 5981 |
| 5982 Send(reply_message_); | 5982 Send(reply_message_); |
| 5983 redirect_query_ = 0; | 5983 redirect_query_ = 0; |
| 5984 reply_message_ = NULL; | 5984 reply_message_ = NULL; |
| 5985 } | 5985 } |
| 5986 | 5986 |
| 5987 void TestingAutomationProvider::OnRemoveProvider() { | 5987 void TestingAutomationProvider::OnRemoveProvider() { |
| 5988 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5988 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 5989 } | 5989 } |
| OLD | NEW |