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

Unified Diff: content/shell/shell_browser_main_parts.cc

Issue 10830260: Add local file system directory listings support for content shell. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/shell_browser_main_parts.cc
===================================================================
--- content/shell/shell_browser_main_parts.cc (revision 150808)
+++ content/shell/shell_browser_main_parts.cc (working copy)
@@ -17,7 +17,9 @@
#include "content/shell/shell_devtools_delegate.h"
#include "content/shell/shell_switches.h"
#include "googleurl/src/gurl.h"
+#include "grit/net_resources.h"
#include "net/base/net_module.h"
+#include "ui/base/resource/resource_bundle.h"
#if defined(OS_ANDROID)
#include "net/base/network_change_notifier.h"
@@ -26,6 +28,8 @@
namespace content {
+namespace {
+
static GURL GetStartupURL() {
CommandLine* command_line = CommandLine::ForCurrentProcess();
if (command_line->HasSwitch(switches::kContentBrowserTest))
@@ -43,6 +47,18 @@
return GURL(args[0]);
}
+base::StringPiece PlatformResourceProvider(int key) {
+ if (key == IDR_DIR_HEADER_HTML) {
+ base::StringPiece html_data =
+ ui::ResourceBundle::GetSharedInstance().GetRawDataResource(
+ IDR_DIR_HEADER_HTML, ui::SCALE_FACTOR_NONE);
+ return html_data;
+ }
+ return base::StringPiece();
+}
+
+} // namespace
+
ShellBrowserMainParts::ShellBrowserMainParts(
const MainFunctionParams& parameters)
: BrowserMainParts(),
@@ -77,7 +93,7 @@
off_the_record_browser_context_.reset(new ShellBrowserContext(true));
Shell::PlatformInitialize();
- net::NetModule::SetResourceProvider(Shell::PlatformResourceProvider);
+ net::NetModule::SetResourceProvider(PlatformResourceProvider);
#if defined(OS_ANDROID)
devtools_delegate_ = new ShellDevToolsDelegate(

Powered by Google App Engine
This is Rietveld 408576698