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

Unified Diff: content/shell/browser/layout_test/layout_test_browser_main_parts.cc

Issue 645713003: Content Shell: Introduce LayoutTestBrowserMainParts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@LayoutTestDownloadManagerDelegate
Patch Set: nullptr Created 6 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 side-by-side diff with in-line comments
Download patch
Index: content/shell/browser/layout_test/layout_test_browser_main_parts.cc
diff --git a/content/shell/browser/layout_test/layout_test_browser_main_parts.cc b/content/shell/browser/layout_test/layout_test_browser_main_parts.cc
new file mode 100644
index 0000000000000000000000000000000000000000..da26b4d4b66cb2d038c4fb8ffec3764fe7693e90
--- /dev/null
+++ b/content/shell/browser/layout_test/layout_test_browser_main_parts.cc
@@ -0,0 +1,92 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/shell/browser/layout_test/layout_test_browser_main_parts.h"
+
+#include "base/base_switches.h"
+#include "base/bind.h"
+#include "base/command_line.h"
+#include "base/files/file_path.h"
+#include "base/message_loop/message_loop.h"
+#include "base/threading/thread.h"
+#include "base/threading/thread_restrictions.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/storage_partition.h"
+#include "content/public/common/content_switches.h"
+#include "content/public/common/main_function_params.h"
+#include "content/public/common/url_constants.h"
+#include "content/shell/browser/layout_test/layout_test_browser_context.h"
+#include "content/shell/browser/shell.h"
+#include "content/shell/browser/shell_browser_context.h"
+#include "content/shell/browser/shell_devtools_delegate.h"
+#include "content/shell/browser/shell_net_log.h"
+#include "content/shell/common/shell_switches.h"
+#include "net/base/filename_util.h"
+#include "net/base/net_module.h"
+#include "net/grit/net_resources.h"
+#include "storage/browser/quota/quota_manager.h"
+#include "ui/base/resource/resource_bundle.h"
+#include "url/gurl.h"
+
+#if defined(ENABLE_PLUGINS)
+#include "content/public/browser/plugin_service.h"
+#include "content/shell/browser/shell_plugin_service_filter.h"
+#endif
+
+#if defined(OS_ANDROID)
+#include "components/crash/browser/crash_dump_manager_android.h"
+#include "net/android/network_change_notifier_factory_android.h"
+#include "net/base/network_change_notifier.h"
+#endif
+
+#if defined(USE_AURA) && defined(USE_X11)
+#include "ui/events/x/touch_factory_x11.h"
+#endif
+#if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX)
+#include "ui/base/ime/input_method_initializer.h"
+#endif
+
+namespace content {
+
+namespace {
+
+// Default quota for each origin is 5MB.
+const int kDefaultLayoutTestQuotaBytes = 5 * 1024 * 1024;
+
+} // namespace
+
+LayoutTestBrowserMainParts::LayoutTestBrowserMainParts(
+ const MainFunctionParams& parameters)
+ : ShellBrowserMainParts(parameters) {
+}
+
+LayoutTestBrowserMainParts::~LayoutTestBrowserMainParts() {
+}
+
+void LayoutTestBrowserMainParts::InitializeBrowserContexts() {
+ set_browser_context(new LayoutTestBrowserContext(false, net_log()));
+ set_off_the_record_browser_context(nullptr);
+}
+
+void LayoutTestBrowserMainParts::InitializeMessageLoopContext() {
+ storage::QuotaManager* quota_manager =
+ BrowserContext::GetDefaultStoragePartition(browser_context())
+ ->GetQuotaManager();
+ BrowserThread::PostTask(
+ BrowserThread::IO,
+ FROM_HERE,
+ base::Bind(&storage::QuotaManager::SetTemporaryGlobalOverrideQuota,
+ quota_manager,
+ kDefaultLayoutTestQuotaBytes *
+ storage::QuotaManager::kPerHostTemporaryPortion,
+ storage::QuotaCallback()));
+
+#if defined(ENABLE_PLUGINS)
+ PluginService* plugin_service = PluginService::GetInstance();
+ plugin_service_filter_.reset(new ShellPluginServiceFilter);
+ plugin_service->SetFilter(plugin_service_filter_.get());
+#endif
+}
+
+} // namespace
« no previous file with comments | « content/shell/browser/layout_test/layout_test_browser_main_parts.h ('k') | content/shell/browser/shell_browser_main_parts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698