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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 EnsureResourceContextInitialized(this); | 188 EnsureResourceContextInitialized(this); |
189 | 189 |
190 blacklist_manager_.reset(CreateURLBlackListManager(user_pref_service_.get())); | 190 blacklist_manager_.reset(CreateURLBlackListManager(user_pref_service_.get())); |
191 | 191 |
192 // UMA uses randomly-generated GUIDs (globally unique identifiers) to | 192 // UMA uses randomly-generated GUIDs (globally unique identifiers) to |
193 // anonymously identify logs. Every WebView-using app on every device | 193 // anonymously identify logs. Every WebView-using app on every device |
194 // is given a GUID, stored in this file in the app's data directory. | 194 // is given a GUID, stored in this file in the app's data directory. |
195 const FilePath guid_file_path = | 195 const FilePath guid_file_path = |
196 GetPath().Append(FILE_PATH_LITERAL("metrics_guid")); | 196 GetPath().Append(FILE_PATH_LITERAL("metrics_guid")); |
197 | |
198 AwMetricsServiceClient::GetInstance()->Initialize( | 197 AwMetricsServiceClient::GetInstance()->Initialize( |
199 user_pref_service_.get(), | 198 user_pref_service_.get(), |
200 content::BrowserContext::GetDefaultStoragePartition(this)-> | 199 content::BrowserContext::GetDefaultStoragePartition(this)-> |
201 GetURLRequestContext(), | 200 GetURLRequestContext(), |
202 guid_file_path); | 201 guid_file_path); |
| 202 |
203 web_restriction_provider_.reset( | 203 web_restriction_provider_.reset( |
204 new web_restrictions::WebRestrictionsClient()); | 204 new web_restrictions::WebRestrictionsClient()); |
205 pref_change_registrar_.Add( | 205 pref_change_registrar_.Add( |
206 prefs::kWebRestrictionsAuthority, | 206 prefs::kWebRestrictionsAuthority, |
207 base::Bind(&AwBrowserContext::OnWebRestrictionsAuthorityChanged, | 207 base::Bind(&AwBrowserContext::OnWebRestrictionsAuthorityChanged, |
208 base::Unretained(this))); | 208 base::Unretained(this))); |
209 web_restriction_provider_->SetAuthority( | 209 web_restriction_provider_->SetAuthority( |
210 user_pref_service_->GetString(prefs::kWebRestrictionsAuthority)); | 210 user_pref_service_->GetString(prefs::kWebRestrictionsAuthority)); |
211 } | 211 } |
212 | 212 |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
379 | 379 |
380 void AwBrowserContext::RebuildTable( | 380 void AwBrowserContext::RebuildTable( |
381 const scoped_refptr<URLEnumerator>& enumerator) { | 381 const scoped_refptr<URLEnumerator>& enumerator) { |
382 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client | 382 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client |
383 // can change in the lifetime of this WebView and may not yet be set here. | 383 // can change in the lifetime of this WebView and may not yet be set here. |
384 // Therefore this initialization path is not used. | 384 // Therefore this initialization path is not used. |
385 enumerator->OnComplete(true); | 385 enumerator->OnComplete(true); |
386 } | 386 } |
387 | 387 |
388 } // namespace android_webview | 388 } // namespace android_webview |
OLD | NEW |