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

Side by Side Diff: chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc

Issue 2649163003: [LanguageModel] Clear the model when clearing full history (Closed)
Patch Set: Rachel's comments Created 3 years, 10 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
« no previous file with comments | « no previous file | chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h" 5 #include "chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 20 matching lines...) Expand all
31 #include "chrome/browser/password_manager/password_store_factory.h" 31 #include "chrome/browser/password_manager/password_store_factory.h"
32 #include "chrome/browser/permissions/permission_decision_auto_blocker.h" 32 #include "chrome/browser/permissions/permission_decision_auto_blocker.h"
33 #include "chrome/browser/prerender/prerender_manager.h" 33 #include "chrome/browser/prerender/prerender_manager.h"
34 #include "chrome/browser/prerender/prerender_manager_factory.h" 34 #include "chrome/browser/prerender/prerender_manager_factory.h"
35 #include "chrome/browser/previews/previews_service.h" 35 #include "chrome/browser/previews/previews_service.h"
36 #include "chrome/browser/previews/previews_service_factory.h" 36 #include "chrome/browser/previews/previews_service_factory.h"
37 #include "chrome/browser/profiles/profile.h" 37 #include "chrome/browser/profiles/profile.h"
38 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 38 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
39 #include "chrome/browser/search_engines/template_url_service_factory.h" 39 #include "chrome/browser/search_engines/template_url_service_factory.h"
40 #include "chrome/browser/sessions/tab_restore_service_factory.h" 40 #include "chrome/browser/sessions/tab_restore_service_factory.h"
41 #include "chrome/browser/translate/language_model_factory.h"
41 #include "chrome/browser/web_data_service_factory.h" 42 #include "chrome/browser/web_data_service_factory.h"
42 #include "chrome/common/features.h" 43 #include "chrome/common/features.h"
43 #include "chrome/common/pref_names.h" 44 #include "chrome/common/pref_names.h"
44 #include "chrome/common/url_constants.h" 45 #include "chrome/common/url_constants.h"
45 #include "components/autofill/core/browser/personal_data_manager.h" 46 #include "components/autofill/core/browser/personal_data_manager.h"
46 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h" 47 #include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
47 #include "components/bookmarks/browser/bookmark_model.h" 48 #include "components/bookmarks/browser/bookmark_model.h"
48 #include "components/content_settings/core/browser/host_content_settings_map.h" 49 #include "components/content_settings/core/browser/host_content_settings_map.h"
49 #include "components/content_settings/core/common/content_settings.h" 50 #include "components/content_settings/core/common/content_settings.h"
50 #include "components/content_settings/core/common/content_settings_pattern.h" 51 #include "components/content_settings/core/common/content_settings_pattern.h"
51 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h" 52 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp ression_stats.h"
52 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h" 53 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv ice.h"
53 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h" 54 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett ings.h"
54 #include "components/domain_reliability/service.h" 55 #include "components/domain_reliability/service.h"
55 #include "components/history/core/browser/history_service.h" 56 #include "components/history/core/browser/history_service.h"
56 #include "components/nacl/browser/nacl_browser.h" 57 #include "components/nacl/browser/nacl_browser.h"
57 #include "components/nacl/browser/pnacl_host.h" 58 #include "components/nacl/browser/pnacl_host.h"
58 #include "components/ntp_snippets/bookmarks/bookmark_last_visit_utils.h" 59 #include "components/ntp_snippets/bookmarks/bookmark_last_visit_utils.h"
59 #include "components/ntp_snippets/content_suggestions_service.h" 60 #include "components/ntp_snippets/content_suggestions_service.h"
60 #include "components/omnibox/browser/omnibox_pref_names.h" 61 #include "components/omnibox/browser/omnibox_pref_names.h"
61 #include "components/password_manager/core/browser/password_store.h" 62 #include "components/password_manager/core/browser/password_store.h"
62 #include "components/prefs/pref_service.h" 63 #include "components/prefs/pref_service.h"
63 #include "components/previews/core/previews_ui_service.h" 64 #include "components/previews/core/previews_ui_service.h"
64 #include "components/search_engines/template_url_service.h" 65 #include "components/search_engines/template_url_service.h"
65 #include "components/sessions/core/tab_restore_service.h" 66 #include "components/sessions/core/tab_restore_service.h"
67 #include "components/translate/core/browser/language_model.h"
66 #include "content/public/browser/plugin_data_remover.h" 68 #include "content/public/browser/plugin_data_remover.h"
67 #include "content/public/browser/ssl_host_state_delegate.h" 69 #include "content/public/browser/ssl_host_state_delegate.h"
68 #include "content/public/browser/storage_partition.h" 70 #include "content/public/browser/storage_partition.h"
69 #include "content/public/browser/user_metrics.h" 71 #include "content/public/browser/user_metrics.h"
70 #include "net/cookies/cookie_store.h" 72 #include "net/cookies/cookie_store.h"
71 #include "net/http/http_transaction_factory.h" 73 #include "net/http/http_transaction_factory.h"
72 #include "net/url_request/url_request_context.h" 74 #include "net/url_request/url_request_context.h"
73 #include "net/url_request/url_request_context_getter.h" 75 #include "net/url_request/url_request_context_getter.h"
74 76
75 #if defined(OS_ANDROID) 77 #if defined(OS_ANDROID)
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 } 370 }
369 371
370 // Remove the last visit dates meta-data from the bookmark model. 372 // Remove the last visit dates meta-data from the bookmark model.
371 bookmarks::BookmarkModel* bookmark_model = 373 bookmarks::BookmarkModel* bookmark_model =
372 BookmarkModelFactory::GetForBrowserContext(profile_); 374 BookmarkModelFactory::GetForBrowserContext(profile_);
373 if (bookmark_model) { 375 if (bookmark_model) {
374 ntp_snippets::RemoveLastVisitedDatesBetween(delete_begin_, delete_end_, 376 ntp_snippets::RemoveLastVisitedDatesBetween(delete_begin_, delete_end_,
375 filter, bookmark_model); 377 filter, bookmark_model);
376 } 378 }
377 379
380 translate::LanguageModel* language_model =
381 LanguageModelFactory::GetInstance()->GetForBrowserContext(profile_);
382 if (language_model) {
383 language_model->ClearHistory(delete_begin_, delete_end_);
384 }
385
378 #if BUILDFLAG(ENABLE_EXTENSIONS) 386 #if BUILDFLAG(ENABLE_EXTENSIONS)
379 // The extension activity log contains details of which websites extensions 387 // The extension activity log contains details of which websites extensions
380 // were active on. It therefore indirectly stores details of websites a 388 // were active on. It therefore indirectly stores details of websites a
381 // user has visited so best clean from here as well. 389 // user has visited so best clean from here as well.
382 // TODO(msramek): Support all backends with filter (crbug.com/589586). 390 // TODO(msramek): Support all backends with filter (crbug.com/589586).
383 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs( 391 extensions::ActivityLog::GetInstance(profile_)->RemoveURLs(
384 std::set<GURL>()); 392 std::set<GURL>());
385 393
386 // Clear launch times as they are a form of history. 394 // Clear launch times as they are a form of history.
387 // BrowsingDataFilterBuilder currently doesn't support extension origins. 395 // BrowsingDataFilterBuilder currently doesn't support extension origins.
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 } 1049 }
1042 1050
1043 void ChromeBrowsingDataRemoverDelegate:: 1051 void ChromeBrowsingDataRemoverDelegate::
1044 OnDeauthorizeFlashContentLicensesCompleted( 1052 OnDeauthorizeFlashContentLicensesCompleted(
1045 uint32_t request_id, 1053 uint32_t request_id,
1046 bool /* success */) { 1054 bool /* success */) {
1047 DCHECK_EQ(request_id, deauthorize_flash_content_licenses_request_id_); 1055 DCHECK_EQ(request_id, deauthorize_flash_content_licenses_request_id_);
1048 clear_flash_content_licenses_.GetCompletionCallback().Run(); 1056 clear_flash_content_licenses_.GetCompletionCallback().Run();
1049 } 1057 }
1050 #endif 1058 #endif
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data/chrome_browsing_data_remover_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698