| OLD | NEW |
| 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 "base/thread.h" | 7 #include "base/thread.h" |
| 8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/extensions/extensions_service.h" | 9 #include "chrome/browser/extensions/extensions_service.h" |
| 10 #include "chrome/browser/extensions/extension_error_reporter.h" | 10 #include "chrome/browser/extensions/extension_error_reporter.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 } | 29 } |
| 30 | 30 |
| 31 void ExtensionsUIHTMLSource::StartDataRequest(const std::string& path, | 31 void ExtensionsUIHTMLSource::StartDataRequest(const std::string& path, |
| 32 int request_id) { | 32 int request_id) { |
| 33 DictionaryValue localized_strings; | 33 DictionaryValue localized_strings; |
| 34 localized_strings.SetString(L"title", | 34 localized_strings.SetString(L"title", |
| 35 l10n_util::GetString(IDS_EXTENSIONS_TITLE)); | 35 l10n_util::GetString(IDS_EXTENSIONS_TITLE)); |
| 36 | 36 |
| 37 static const StringPiece extensions_html( | 37 static const StringPiece extensions_html( |
| 38 ResourceBundle::GetSharedInstance().GetRawDataResource( | 38 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 39 IDR_EXTENSIONS_HTML)); | 39 IDR_EXTENSIONS_UI_HTML)); |
| 40 const std::string full_html = jstemplate_builder::GetTemplateHtml( | 40 const std::string full_html = jstemplate_builder::GetTemplateHtml( |
| 41 extensions_html, &localized_strings, "root"); | 41 extensions_html, &localized_strings, "root"); |
| 42 | 42 |
| 43 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); | 43 scoped_refptr<RefCountedBytes> html_bytes(new RefCountedBytes); |
| 44 html_bytes->data.resize(full_html.size()); | 44 html_bytes->data.resize(full_html.size()); |
| 45 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); | 45 std::copy(full_html.begin(), full_html.end(), html_bytes->data.begin()); |
| 46 | 46 |
| 47 SendResponse(request_id, html_bytes); | 47 SendResponse(request_id, html_bytes); |
| 48 } | 48 } |
| 49 | 49 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 AddMessageHandler(handler); | 167 AddMessageHandler(handler); |
| 168 handler->Init(); | 168 handler->Init(); |
| 169 | 169 |
| 170 ExtensionsUIHTMLSource* html_source = new ExtensionsUIHTMLSource(); | 170 ExtensionsUIHTMLSource* html_source = new ExtensionsUIHTMLSource(); |
| 171 | 171 |
| 172 // Set up the chrome-ui://extensions/ source. | 172 // Set up the chrome-ui://extensions/ source. |
| 173 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, | 173 g_browser_process->io_thread()->message_loop()->PostTask(FROM_HERE, |
| 174 NewRunnableMethod(&chrome_url_data_manager, | 174 NewRunnableMethod(&chrome_url_data_manager, |
| 175 &ChromeURLDataManager::AddDataSource, html_source)); | 175 &ChromeURLDataManager::AddDataSource, html_source)); |
| 176 } | 176 } |
| OLD | NEW |