OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "android_webview/browser/aw_browser_context.h" | 5 #include "android_webview/browser/aw_browser_context.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "android_webview/browser/aw_browser_policy_connector.h" | 9 #include "android_webview/browser/aw_browser_policy_connector.h" |
10 #include "android_webview/browser/aw_form_database_service.h" | 10 #include "android_webview/browser/aw_form_database_service.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 data_reduction_proxy_settings_->MaybeActivateDataReductionProxy(true); | 252 data_reduction_proxy_settings_->MaybeActivateDataReductionProxy(true); |
253 | 253 |
254 blacklist_manager_.reset(CreateURLBlackListManager(user_pref_service_.get())); | 254 blacklist_manager_.reset(CreateURLBlackListManager(user_pref_service_.get())); |
255 | 255 |
256 // UMA uses randomly-generated GUIDs (globally unique identifiers) to | 256 // UMA uses randomly-generated GUIDs (globally unique identifiers) to |
257 // anonymously identify logs. Every WebView-using app on every device | 257 // anonymously identify logs. Every WebView-using app on every device |
258 // is given a GUID, stored in this file in the app's data directory. | 258 // is given a GUID, stored in this file in the app's data directory. |
259 const FilePath guid_file_path = | 259 const FilePath guid_file_path = |
260 GetPath().Append(FILE_PATH_LITERAL("metrics_guid")); | 260 GetPath().Append(FILE_PATH_LITERAL("metrics_guid")); |
261 | 261 |
262 AwMetricsServiceClient::GetInstance()->Initialize( | 262 AwMetricsServiceClient::GetInstance()->Initialize(user_pref_service_.get(), |
263 user_pref_service_.get(), | 263 GetRequestContext(), |
264 content::BrowserContext::GetDefaultStoragePartition(this)-> | 264 guid_file_path); |
265 GetURLRequestContext(), | |
266 guid_file_path); | |
267 } | 265 } |
268 | 266 |
269 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { | 267 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { |
270 DCHECK(visitedlink_master_); | 268 DCHECK(visitedlink_master_); |
271 visitedlink_master_->AddURLs(urls); | 269 visitedlink_master_->AddURLs(urls); |
272 } | 270 } |
273 | 271 |
274 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() { | 272 AwQuotaManagerBridge* AwBrowserContext::GetQuotaManagerBridge() { |
275 if (!quota_manager_bridge_.get()) { | 273 if (!quota_manager_bridge_.get()) { |
276 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this); | 274 quota_manager_bridge_ = native_factory_->CreateAwQuotaManagerBridge(this); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
343 | 341 |
344 base::FilePath AwBrowserContext::GetPath() const { | 342 base::FilePath AwBrowserContext::GetPath() const { |
345 return context_storage_path_; | 343 return context_storage_path_; |
346 } | 344 } |
347 | 345 |
348 bool AwBrowserContext::IsOffTheRecord() const { | 346 bool AwBrowserContext::IsOffTheRecord() const { |
349 // Android WebView does not support off the record profile yet. | 347 // Android WebView does not support off the record profile yet. |
350 return false; | 348 return false; |
351 } | 349 } |
352 | 350 |
| 351 net::URLRequestContextGetter* AwBrowserContext::GetRequestContext() { |
| 352 return GetDefaultStoragePartition(this)->GetURLRequestContext(); |
| 353 } |
| 354 |
353 net::URLRequestContextGetter* AwBrowserContext::GetMediaRequestContext() { | 355 net::URLRequestContextGetter* AwBrowserContext::GetMediaRequestContext() { |
354 return content::BrowserContext::GetDefaultStoragePartition(this)-> | 356 return GetRequestContext(); |
355 GetURLRequestContext(); | |
356 } | 357 } |
357 | 358 |
358 net::URLRequestContextGetter* | 359 net::URLRequestContextGetter* |
359 AwBrowserContext::GetMediaRequestContextForRenderProcess( | 360 AwBrowserContext::GetMediaRequestContextForRenderProcess( |
360 int renderer_child_id) { | 361 int renderer_child_id) { |
361 return content::BrowserContext::GetDefaultStoragePartition(this)-> | 362 return GetRequestContext(); |
362 GetURLRequestContext(); | |
363 } | 363 } |
364 | 364 |
365 net::URLRequestContextGetter* | 365 net::URLRequestContextGetter* |
366 AwBrowserContext::GetMediaRequestContextForStoragePartition( | 366 AwBrowserContext::GetMediaRequestContextForStoragePartition( |
367 const base::FilePath& partition_path, | 367 const base::FilePath& partition_path, |
368 bool in_memory) { | 368 bool in_memory) { |
369 NOTREACHED(); | 369 NOTREACHED(); |
370 return NULL; | 370 return NULL; |
371 } | 371 } |
372 | 372 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 return; | 465 return; |
466 // We don't care about commit_delay for now. It is just a dummy value. | 466 // We don't care about commit_delay for now. It is just a dummy value. |
467 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); | 467 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); |
468 data_reduction_proxy_service->EnableCompressionStatisticsLogging( | 468 data_reduction_proxy_service->EnableCompressionStatisticsLogging( |
469 user_pref_service_.get(), | 469 user_pref_service_.get(), |
470 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 470 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
471 commit_delay); | 471 commit_delay); |
472 } | 472 } |
473 | 473 |
474 } // namespace android_webview | 474 } // namespace android_webview |
OLD | NEW |