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

Side by Side Diff: android_webview/browser/aw_browser_context.cc

Issue 2932703003: Plumbing for safe browsing reporting for Android WebView. (Closed)
Patch Set: add TODO Created 3 years, 6 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
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 199
200 web_restriction_provider_.reset( 200 web_restriction_provider_.reset(
201 new web_restrictions::WebRestrictionsClient()); 201 new web_restrictions::WebRestrictionsClient());
202 pref_change_registrar_.Add( 202 pref_change_registrar_.Add(
203 prefs::kWebRestrictionsAuthority, 203 prefs::kWebRestrictionsAuthority,
204 base::Bind(&AwBrowserContext::OnWebRestrictionsAuthorityChanged, 204 base::Bind(&AwBrowserContext::OnWebRestrictionsAuthorityChanged,
205 base::Unretained(this))); 205 base::Unretained(this)));
206 web_restriction_provider_->SetAuthority( 206 web_restriction_provider_->SetAuthority(
207 user_pref_service_->GetString(prefs::kWebRestrictionsAuthority)); 207 user_pref_service_->GetString(prefs::kWebRestrictionsAuthority));
208 208
209 safe_browsing_ui_manager_ = new AwSafeBrowsingUIManager(); 209 safe_browsing_ui_manager_ =
210 new AwSafeBrowsingUIManager(GetAwURLRequestContext());
210 safe_browsing_db_manager_ = 211 safe_browsing_db_manager_ =
211 new safe_browsing::RemoteSafeBrowsingDatabaseManager(); 212 new safe_browsing::RemoteSafeBrowsingDatabaseManager();
213 // TODO(timvolodine): create trigger_manager_ using ui_manager_
212 } 214 }
213 215
214 void AwBrowserContext::OnWebRestrictionsAuthorityChanged() { 216 void AwBrowserContext::OnWebRestrictionsAuthorityChanged() {
215 web_restriction_provider_->SetAuthority( 217 web_restriction_provider_->SetAuthority(
216 user_pref_service_->GetString(prefs::kWebRestrictionsAuthority)); 218 user_pref_service_->GetString(prefs::kWebRestrictionsAuthority));
217 } 219 }
218 220
219 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) { 221 void AwBrowserContext::AddVisitedURLs(const std::vector<GURL>& urls) {
220 DCHECK(visitedlink_master_); 222 DCHECK(visitedlink_master_);
221 visitedlink_master_->AddURLs(urls); 223 visitedlink_master_->AddURLs(urls);
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 399
398 void AwBrowserContext::RebuildTable( 400 void AwBrowserContext::RebuildTable(
399 const scoped_refptr<URLEnumerator>& enumerator) { 401 const scoped_refptr<URLEnumerator>& enumerator) {
400 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client 402 // Android WebView rebuilds from WebChromeClient.getVisitedHistory. The client
401 // can change in the lifetime of this WebView and may not yet be set here. 403 // can change in the lifetime of this WebView and may not yet be set here.
402 // Therefore this initialization path is not used. 404 // Therefore this initialization path is not used.
403 enumerator->OnComplete(true); 405 enumerator->OnComplete(true);
404 } 406 }
405 407
406 } // namespace android_webview 408 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698