Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: chrome/browser/extensions/extensions_ui.cc

Issue 164039: Add module-level permissions to extensions. (Closed)
Patch Set: final nits Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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/extensions_ui.h" 5 #include "chrome/browser/extensions/extensions_ui.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/thread.h" 10 #include "base/thread.h"
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 UserScriptList content_scripts = extension->content_scripts(); 200 UserScriptList content_scripts = extension->content_scripts();
201 for (UserScriptList::const_iterator script = content_scripts.begin(); 201 for (UserScriptList::const_iterator script = content_scripts.begin();
202 script != content_scripts.end(); ++script) { 202 script != content_scripts.end(); ++script) {
203 content_script_list->Append(CreateContentScriptDetailValue(*script, 203 content_script_list->Append(CreateContentScriptDetailValue(*script,
204 extension->path())); 204 extension->path()));
205 } 205 }
206 extension_data->Set(L"content_scripts", content_script_list); 206 extension_data->Set(L"content_scripts", content_script_list);
207 207
208 // Add permissions 208 // Add permissions
209 ListValue *permission_list = new ListValue; 209 ListValue *permission_list = new ListValue;
210 std::vector<URLPattern> permissions = extension->permissions(); 210 std::vector<URLPattern> permissions = extension->host_permissions();
211 for (std::vector<URLPattern>::iterator permission = permissions.begin(); 211 for (std::vector<URLPattern>::iterator permission = permissions.begin();
212 permission != permissions.end(); ++permission) { 212 permission != permissions.end(); ++permission) {
213 permission_list->Append(Value::CreateStringValue( 213 permission_list->Append(Value::CreateStringValue(
214 permission->GetAsString())); 214 permission->GetAsString()));
215 } 215 }
216 extension_data->Set(L"permissions", permission_list); 216 extension_data->Set(L"permissions", permission_list);
217 217
218 // Add views 218 // Add views
219 ListValue* views = new ListValue; 219 ListValue* views = new ListValue;
220 for (std::vector<ExtensionPage>::const_iterator iter = pages.begin(); 220 for (std::vector<ExtensionPage>::const_iterator iter = pages.begin();
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 AddMessageHandler(handler); 263 AddMessageHandler(handler);
264 handler->Attach(this); 264 handler->Attach(this);
265 265
266 ExtensionsUIHTMLSource* html_source = new ExtensionsUIHTMLSource(); 266 ExtensionsUIHTMLSource* html_source = new ExtensionsUIHTMLSource();
267 267
268 // Set up the chrome://extensions/ source. 268 // Set up the chrome://extensions/ source.
269 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, 269 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
270 NewRunnableMethod(&chrome_url_data_manager, 270 NewRunnableMethod(&chrome_url_data_manager,
271 &ChromeURLDataManager::AddDataSource, html_source)); 271 &ChromeURLDataManager::AddDataSource, html_source));
272 } 272 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extensions_service_unittest.cc ('k') | chrome/common/common_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698