Chromium Code Reviews| 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 "android_webview/browser/net/aw_url_request_context_getter.h" | 7 #include "android_webview/browser/net/aw_url_request_context_getter.h" |
| 8 | 8 |
| 9 namespace android_webview { | 9 namespace android_webview { |
| 10 | 10 |
| 11 AwBrowserContext::AwBrowserContext(const FilePath path) | 11 AwBrowserContext::AwBrowserContext( |
| 12 : context_storage_path_(path) { | 12 const FilePath path, |
| 13 GeolocationPermissionGetterFn* geolocation_permission_getter) | |
| 14 : context_storage_path_(path), | |
| 15 geolocation_permission_getter_(geolocation_permission_getter), | |
| 16 geolocation_permission_context_(NULL) { | |
|
boliu_use_chromium_pls
2013/01/04 23:45:43
nit: scoped_refptr defaults constructs to NULL, so
Kristian Monsen
2013/01/05 02:44:58
Done.
| |
| 13 } | 17 } |
| 14 | 18 |
| 15 AwBrowserContext::~AwBrowserContext() { | 19 AwBrowserContext::~AwBrowserContext() { |
| 16 } | 20 } |
| 17 | 21 |
| 18 void AwBrowserContext::InitializeBeforeThreadCreation() { | 22 void AwBrowserContext::InitializeBeforeThreadCreation() { |
| 19 DCHECK(!url_request_context_getter_); | 23 DCHECK(!url_request_context_getter_); |
| 20 url_request_context_getter_ = new AwURLRequestContextGetter(this); | 24 url_request_context_getter_ = new AwURLRequestContextGetter(this); |
| 21 } | 25 } |
| 22 | 26 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 68 return url_request_context_getter_->GetResourceContext(); | 72 return url_request_context_getter_->GetResourceContext(); |
| 69 } | 73 } |
| 70 | 74 |
| 71 content::DownloadManagerDelegate* | 75 content::DownloadManagerDelegate* |
| 72 AwBrowserContext::GetDownloadManagerDelegate() { | 76 AwBrowserContext::GetDownloadManagerDelegate() { |
| 73 return &download_manager_delegate_; | 77 return &download_manager_delegate_; |
| 74 } | 78 } |
| 75 | 79 |
| 76 content::GeolocationPermissionContext* | 80 content::GeolocationPermissionContext* |
| 77 AwBrowserContext::GetGeolocationPermissionContext() { | 81 AwBrowserContext::GetGeolocationPermissionContext() { |
| 78 // TODO(boliu): Implement this to power WebSettings.setGeolocationEnabled | 82 if (geolocation_permission_context_ == NULL) { |
|
boliu_use_chromium_pls
2013/01/04 23:45:43
nit: I believe you can just do if (!geolocation_pe
Kristian Monsen
2013/01/05 02:44:58
Compiler agrees.
| |
| 79 // setting. | 83 geolocation_permission_context_ = (*geolocation_permission_getter_)(); |
| 80 NOTIMPLEMENTED(); | 84 } |
| 81 return NULL; | 85 return geolocation_permission_context_; |
| 82 } | 86 } |
| 83 | 87 |
| 84 content::SpeechRecognitionPreferences* | 88 content::SpeechRecognitionPreferences* |
| 85 AwBrowserContext::GetSpeechRecognitionPreferences() { | 89 AwBrowserContext::GetSpeechRecognitionPreferences() { |
| 86 // By default allows profanities in speech recognition if return NULL. | 90 // By default allows profanities in speech recognition if return NULL. |
| 87 return NULL; | 91 return NULL; |
| 88 } | 92 } |
| 89 | 93 |
| 90 quota::SpecialStoragePolicy* AwBrowserContext::GetSpecialStoragePolicy() { | 94 quota::SpecialStoragePolicy* AwBrowserContext::GetSpecialStoragePolicy() { |
| 91 // TODO(boliu): Implement this so we are not relying on default behavior. | 95 // TODO(boliu): Implement this so we are not relying on default behavior. |
| 92 NOTIMPLEMENTED(); | 96 NOTIMPLEMENTED(); |
| 93 return NULL; | 97 return NULL; |
| 94 } | 98 } |
| 95 | 99 |
| 96 } // namespace android_webview | 100 } // namespace android_webview |
| OLD | NEW |