| 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 4062 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4073 return_value->Set("images", theme->GetThemeImages()->DeepCopy()); | 4073 return_value->Set("images", theme->GetThemeImages()->DeepCopy()); |
| 4074 return_value->Set("colors", theme->GetThemeColors()->DeepCopy()); | 4074 return_value->Set("colors", theme->GetThemeColors()->DeepCopy()); |
| 4075 return_value->Set("tints", theme->GetThemeTints()->DeepCopy()); | 4075 return_value->Set("tints", theme->GetThemeTints()->DeepCopy()); |
| 4076 } | 4076 } |
| 4077 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); | 4077 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); |
| 4078 } | 4078 } |
| 4079 | 4079 |
| 4080 namespace { | 4080 namespace { |
| 4081 | 4081 |
| 4082 ListValue* GetHostPermissions(const Extension* ext, bool effective_perm) { | 4082 ListValue* GetHostPermissions(const Extension* ext, bool effective_perm) { |
| 4083 URLPatternList pattern_list; | 4083 URLPatternSet pattern_set; |
| 4084 if (effective_perm) | 4084 if (effective_perm) |
| 4085 pattern_list = ext->GetEffectiveHostPermissions().patterns(); | 4085 pattern_set = ext->GetEffectiveHostPermissions(); |
| 4086 else | 4086 else |
| 4087 pattern_list = ext->permission_set()->explicit_hosts().patterns(); | 4087 pattern_set = ext->permission_set()->explicit_hosts(); |
| 4088 | 4088 |
| 4089 ListValue* permissions = new ListValue; | 4089 ListValue* permissions = new ListValue; |
| 4090 for (URLPatternList::const_iterator perm = pattern_list.begin(); | 4090 for (URLPatternSet::const_iterator perm = pattern_set.begin(); |
| 4091 perm != pattern_list.end(); ++perm) { | 4091 perm != pattern_set.end(); ++perm) { |
| 4092 permissions->Append(new StringValue(perm->GetAsString())); | 4092 permissions->Append(new StringValue(perm->GetAsString())); |
| 4093 } | 4093 } |
| 4094 | 4094 |
| 4095 return permissions; | 4095 return permissions; |
| 4096 } | 4096 } |
| 4097 | 4097 |
| 4098 ListValue* GetAPIPermissions(const Extension* ext) { | 4098 ListValue* GetAPIPermissions(const Extension* ext) { |
| 4099 ListValue* permissions = new ListValue; | 4099 ListValue* permissions = new ListValue; |
| 4100 std::set<std::string> perm_list = ext->permission_set()->GetAPIsAsStrings(); | 4100 std::set<std::string> perm_list = ext->permission_set()->GetAPIsAsStrings(); |
| 4101 for (std::set<std::string>::const_iterator perm = perm_list.begin(); | 4101 for (std::set<std::string>::const_iterator perm = perm_list.begin(); |
| (...skipping 1948 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6050 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); | 6050 IPC::ParamTraits<std::vector<GURL> >::Write(reply_message_, redirects_gurl); |
| 6051 | 6051 |
| 6052 Send(reply_message_); | 6052 Send(reply_message_); |
| 6053 redirect_query_ = 0; | 6053 redirect_query_ = 0; |
| 6054 reply_message_ = NULL; | 6054 reply_message_ = NULL; |
| 6055 } | 6055 } |
| 6056 | 6056 |
| 6057 void TestingAutomationProvider::OnRemoveProvider() { | 6057 void TestingAutomationProvider::OnRemoveProvider() { |
| 6058 AutomationProviderList::GetInstance()->RemoveProvider(this); | 6058 AutomationProviderList::GetInstance()->RemoveProvider(this); |
| 6059 } | 6059 } |
| OLD | NEW |