OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "headless/lib/browser/headless_content_browser_client.h" | 5 #include "headless/lib/browser/headless_content_browser_client.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <unordered_set> | 8 #include <unordered_set> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/json/json_reader.h" | 11 #include "base/json/json_reader.h" |
12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
13 #include "content/public/browser/browser_context.h" | 13 #include "content/public/browser/browser_context.h" |
14 #include "content/public/browser/browser_thread.h" | 14 #include "content/public/browser/browser_thread.h" |
15 #include "content/public/browser/render_process_host.h" | 15 #include "content/public/browser/render_process_host.h" |
16 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
17 #include "content/public/browser/storage_partition.h" | |
18 #include "content/public/common/service_names.mojom.h" | 17 #include "content/public/common/service_names.mojom.h" |
19 #include "headless/grit/headless_lib_resources.h" | 18 #include "headless/grit/headless_lib_resources.h" |
20 #include "headless/lib/browser/headless_browser_context_impl.h" | 19 #include "headless/lib/browser/headless_browser_context_impl.h" |
21 #include "headless/lib/browser/headless_browser_impl.h" | 20 #include "headless/lib/browser/headless_browser_impl.h" |
22 #include "headless/lib/browser/headless_browser_main_parts.h" | 21 #include "headless/lib/browser/headless_browser_main_parts.h" |
23 #include "headless/lib/browser/headless_devtools_manager_delegate.h" | 22 #include "headless/lib/browser/headless_devtools_manager_delegate.h" |
24 #include "storage/browser/quota/quota_settings.h" | |
25 #include "ui/base/resource/resource_bundle.h" | 23 #include "ui/base/resource/resource_bundle.h" |
26 | 24 |
27 namespace headless { | 25 namespace headless { |
28 | 26 |
29 namespace { | 27 namespace { |
30 const char kCapabilityPath[] = | 28 const char kCapabilityPath[] = |
31 "interface_provider_specs.navigation:frame.provides.renderer"; | 29 "interface_provider_specs.navigation:frame.provides.renderer"; |
32 } // namespace | 30 } // namespace |
33 | 31 |
34 HeadlessContentBrowserClient::HeadlessContentBrowserClient( | 32 HeadlessContentBrowserClient::HeadlessContentBrowserClient( |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 base::ListValue* capability_list = nullptr; | 79 base::ListValue* capability_list = nullptr; |
82 CHECK(manifest_dictionary->GetList(kCapabilityPath, &capability_list)); | 80 CHECK(manifest_dictionary->GetList(kCapabilityPath, &capability_list)); |
83 | 81 |
84 for (std::string service_name : browser_->options()->mojo_service_names) { | 82 for (std::string service_name : browser_->options()->mojo_service_names) { |
85 capability_list->AppendString(service_name); | 83 capability_list->AppendString(service_name); |
86 } | 84 } |
87 | 85 |
88 return manifest; | 86 return manifest; |
89 } | 87 } |
90 | 88 |
91 void HeadlessContentBrowserClient::GetQuotaSettings( | |
92 content::BrowserContext* context, | |
93 content::StoragePartition* partition, | |
94 const storage::OptionalQuotaSettingsCallback& callback) { | |
95 content::BrowserThread::PostTaskAndReplyWithResult( | |
96 content::BrowserThread::FILE, FROM_HERE, | |
97 base::Bind(&storage::CalculateNominalDynamicSettings, | |
98 partition->GetPath(), context->IsOffTheRecord()), | |
99 callback); | |
100 } | |
101 | |
102 } // namespace headless | 89 } // namespace headless |
OLD | NEW |