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/ui/webui/options/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/options/extension_settings_handler.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 void ExtensionSettingsHandler::HandleRequestExtensionsData( | 144 void ExtensionSettingsHandler::HandleRequestExtensionsData( |
145 const ListValue* args) { | 145 const ListValue* args) { |
146 DictionaryValue results; | 146 DictionaryValue results; |
147 | 147 |
148 // Add the extensions to the results structure. | 148 // Add the extensions to the results structure. |
149 ListValue *extensions_list = new ListValue(); | 149 ListValue *extensions_list = new ListValue(); |
150 | 150 |
151 ExtensionWarningSet* warnings = extension_service_->extension_warnings(); | 151 ExtensionWarningSet* warnings = extension_service_->extension_warnings(); |
152 | 152 |
153 const ExtensionSet* extensions = extension_service_->extensions(); | 153 const ExtensionList* extensions = extension_service_->extensions(); |
154 for (ExtensionSet::const_iterator extension = extensions->begin(); | 154 for (ExtensionList::const_iterator extension = extensions->begin(); |
155 extension != extensions->end(); ++extension) { | 155 extension != extensions->end(); ++extension) { |
156 if (ShouldShowExtension(*extension)) { | 156 if (ShouldShowExtension(*extension)) { |
157 extensions_list->Append(CreateExtensionDetailValue( | 157 extensions_list->Append(CreateExtensionDetailValue( |
158 extension_service_, | 158 extension_service_, |
159 *extension, | 159 *extension, |
160 GetActivePagesForExtension(*extension), | 160 GetActivePagesForExtension(*extension), |
161 warnings, | 161 warnings, |
162 true, false)); // enabled, terminated | 162 true, false)); // enabled, terminated |
163 } | 163 } |
164 } | 164 } |
165 extensions = extension_service_->disabled_extensions(); | 165 extensions = extension_service_->disabled_extensions(); |
166 for (ExtensionSet::const_iterator extension = extensions->begin(); | 166 for (ExtensionList::const_iterator extension = extensions->begin(); |
167 extension != extensions->end(); ++extension) { | 167 extension != extensions->end(); ++extension) { |
168 if (ShouldShowExtension(*extension)) { | 168 if (ShouldShowExtension(*extension)) { |
169 extensions_list->Append(CreateExtensionDetailValue( | 169 extensions_list->Append(CreateExtensionDetailValue( |
170 extension_service_, | 170 extension_service_, |
171 *extension, | 171 *extension, |
172 GetActivePagesForExtension(*extension), | 172 GetActivePagesForExtension(*extension), |
173 warnings, | 173 warnings, |
174 false, false)); // enabled, terminated | 174 false, false)); // enabled, terminated |
175 } | 175 } |
176 } | 176 } |
177 extensions = extension_service_->terminated_extensions(); | 177 extensions = extension_service_->terminated_extensions(); |
178 std::vector<ExtensionPage> empty_pages; | 178 std::vector<ExtensionPage> empty_pages; |
179 for (ExtensionSet::const_iterator extension = extensions->begin(); | 179 for (ExtensionList::const_iterator extension = extensions->begin(); |
180 extension != extensions->end(); ++extension) { | 180 extension != extensions->end(); ++extension) { |
181 if (ShouldShowExtension(*extension)) { | 181 if (ShouldShowExtension(*extension)) { |
182 extensions_list->Append(CreateExtensionDetailValue( | 182 extensions_list->Append(CreateExtensionDetailValue( |
183 extension_service_, | 183 extension_service_, |
184 *extension, | 184 *extension, |
185 empty_pages, // Terminated process has no active pages. | 185 empty_pages, // Terminated process has no active pages. |
186 warnings, | 186 warnings, |
187 false, true)); // enabled, terminated | 187 false, true)); // enabled, terminated |
188 } | 188 } |
189 } | 189 } |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) | 776 chrome::VIEW_TYPE_EXTENSION_DIALOG == host_type) |
777 continue; | 777 continue; |
778 | 778 |
779 GURL url = host->delegate()->GetURL(); | 779 GURL url = host->delegate()->GetURL(); |
780 content::RenderProcessHost* process = host->process(); | 780 content::RenderProcessHost* process = host->process(); |
781 result->push_back( | 781 result->push_back( |
782 ExtensionPage(url, process->GetID(), host->routing_id(), | 782 ExtensionPage(url, process->GetID(), host->routing_id(), |
783 process->GetBrowserContext()->IsOffTheRecord())); | 783 process->GetBrowserContext()->IsOffTheRecord())); |
784 } | 784 } |
785 } | 785 } |
OLD | NEW |