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

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

Issue 267051: Minimize dependency of user scripts.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 const wchar_t* key, DictionaryValue* script_data) { 372 const wchar_t* key, DictionaryValue* script_data) {
373 if (scripts.empty()) 373 if (scripts.empty())
374 return; 374 return;
375 375
376 ListValue *list = new ListValue(); 376 ListValue *list = new ListValue();
377 for (size_t i = 0; i < scripts.size(); ++i) { 377 for (size_t i = 0; i < scripts.size(); ++i) {
378 const UserScript::File& file = scripts[i]; 378 const UserScript::File& file = scripts[i];
379 // TODO(cira): this information is not used on extension page yet. We 379 // TODO(cira): this information is not used on extension page yet. We
380 // may want to display actual resource that got loaded, not default. 380 // may want to display actual resource that got loaded, not default.
381 list->Append( 381 list->Append(
382 new StringValue(file.resource().relative_path().value())); 382 new StringValue(file.relative_path().value()));
383 } 383 }
384 script_data->Set(key, list); 384 script_data->Set(key, list);
385 } 385 }
386 386
387 // Static 387 // Static
388 DictionaryValue* ExtensionsDOMHandler::CreateContentScriptDetailValue( 388 DictionaryValue* ExtensionsDOMHandler::CreateContentScriptDetailValue(
389 const UserScript& script, const FilePath& extension_path) { 389 const UserScript& script, const FilePath& extension_path) {
390 DictionaryValue* script_data = new DictionaryValue(); 390 DictionaryValue* script_data = new DictionaryValue();
391 CreateScriptFileDetailValue(extension_path, script.js_scripts(), L"js", 391 CreateScriptFileDetailValue(extension_path, script.js_scripts(), L"js",
392 script_data); 392 script_data);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 AddMessageHandler(handler); 492 AddMessageHandler(handler);
493 handler->Attach(this); 493 handler->Attach(this);
494 494
495 ExtensionsUIHTMLSource* html_source = new ExtensionsUIHTMLSource(); 495 ExtensionsUIHTMLSource* html_source = new ExtensionsUIHTMLSource();
496 496
497 // Set up the chrome://extensions/ source. 497 // Set up the chrome://extensions/ source.
498 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, 498 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE,
499 NewRunnableMethod(&chrome_url_data_manager, 499 NewRunnableMethod(&chrome_url_data_manager,
500 &ChromeURLDataManager::AddDataSource, html_source)); 500 &ChromeURLDataManager::AddDataSource, html_source));
501 } 501 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698