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

Side by Side 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: Ugh. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h"
6
7 #include "base/base_switches.h"
8 #include "base/bind.h"
9 #include "base/command_line.h"
10 #include "base/files/file_path.h"
11 #include "base/message_loop/message_loop.h"
12 #include "base/threading/thread.h"
13 #include "base/threading/thread_restrictions.h"
14 #include "content/public/browser/browser_thread.h"
15 #include "content/public/browser/storage_partition.h"
16 #include "content/public/common/content_switches.h"
17 #include "content/public/common/main_function_params.h"
18 #include "content/public/common/url_constants.h"
19 #include "content/shell/browser/layout_test/layout_test_browser_context.h"
20 #include "content/shell/browser/shell.h"
21 #include "content/shell/browser/shell_browser_context.h"
22 #include "content/shell/browser/shell_devtools_delegate.h"
23 #include "content/shell/browser/shell_net_log.h"
24 #include "content/shell/common/shell_switches.h"
25 #include "net/base/filename_util.h"
26 #include "net/base/net_module.h"
27 #include "net/grit/net_resources.h"
28 #include "storage/browser/quota/quota_manager.h"
29 #include "ui/base/resource/resource_bundle.h"
30 #include "url/gurl.h"
31
32 #if defined(ENABLE_PLUGINS)
33 #include "content/public/browser/plugin_service.h"
34 #include "content/shell/browser/shell_plugin_service_filter.h"
35 #endif
36
37 #if defined(OS_ANDROID)
38 #include "components/crash/browser/crash_dump_manager_android.h"
39 #include "net/android/network_change_notifier_factory_android.h"
40 #include "net/base/network_change_notifier.h"
41 #endif
42
43 #if defined(USE_AURA) && defined(USE_X11)
44 #include "ui/events/x/touch_factory_x11.h"
45 #endif
46 #if !defined(OS_CHROMEOS) && defined(USE_AURA) && defined(OS_LINUX)
47 #include "ui/base/ime/input_method_initializer.h"
48 #endif
49
50 namespace content {
51
52 namespace {
53
54 // Default quota for each origin is 5MB.
55 const int kDefaultLayoutTestQuotaBytes = 5 * 1024 * 1024;
56
57 } // namespace
58
59 LayoutTestBrowserMainParts::LayoutTestBrowserMainParts(
60 const MainFunctionParams& parameters)
61 : ShellBrowserMainParts(parameters) {
62 }
63
64 LayoutTestBrowserMainParts::~LayoutTestBrowserMainParts() {
65 }
66
67 void LayoutTestBrowserMainParts::InitializeBrowserContexts() {
68 browser_context_.reset(new LayoutTestBrowserContext(false, net_log()));
69 off_the_record_browser_context_.reset(
70 new LayoutTestBrowserContext(true, net_log()));
71 }
72
73 void LayoutTestBrowserMainParts::InitializeMessageLoopContext() {
74 storage::QuotaManager* quota_manager =
75 BrowserContext::GetDefaultStoragePartition(browser_context())
76 ->GetQuotaManager();
77 BrowserThread::PostTask(
78 BrowserThread::IO,
79 FROM_HERE,
80 base::Bind(&storage::QuotaManager::SetTemporaryGlobalOverrideQuota,
81 quota_manager,
82 kDefaultLayoutTestQuotaBytes *
83 storage::QuotaManager::kPerHostTemporaryPortion,
84 storage::QuotaCallback()));
85
86 #if defined(ENABLE_PLUGINS)
87 PluginService* plugin_service = PluginService::GetInstance();
88 plugin_service_filter_.reset(new ShellPluginServiceFilter);
89 plugin_service->SetFilter(plugin_service_filter_.get());
90 #endif
91 }
92
93 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698