OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_remover.h" | 5 #include "chrome/browser/browsing_data_remover.h" |
6 | 6 |
7 #include "chrome/browser/chrome_thread.h" | 7 #include "chrome/browser/chrome_thread.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/download/download_manager.h" | 9 #include "chrome/browser/download/download_manager.h" |
10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 Source<TemplateURLModel>(keywords_model)); | 71 Source<TemplateURLModel>(keywords_model)); |
72 keywords_model->Load(); | 72 keywords_model->Load(); |
73 } else if (keywords_model) { | 73 } else if (keywords_model) { |
74 keywords_model->RemoveAutoGeneratedBetween(delete_begin_, delete_end_); | 74 keywords_model->RemoveAutoGeneratedBetween(delete_begin_, delete_end_); |
75 } | 75 } |
76 | 76 |
77 // We also delete the list of recently closed tabs. Since these expire, | 77 // We also delete the list of recently closed tabs. Since these expire, |
78 // they can't be more than a day old, so we can simply clear them all. | 78 // they can't be more than a day old, so we can simply clear them all. |
79 TabRestoreService* tab_service = profile_->GetTabRestoreService(); | 79 TabRestoreService* tab_service = profile_->GetTabRestoreService(); |
80 if (tab_service) | 80 if (tab_service) |
81 tab_service->ClearHistoricalTabs(); | 81 tab_service->ClearEntries(); |
82 | 82 |
83 // We also delete the last session when we delete the history. | 83 // We also delete the last session when we delete the history. |
84 SessionService* session_service = profile_->GetSessionService(); | 84 SessionService* session_service = profile_->GetSessionService(); |
85 if (session_service) | 85 if (session_service) |
86 session_service->DeleteSession(false); // Last session. | 86 session_service->DeleteSession(false); // Last session. |
87 } | 87 } |
88 | 88 |
89 if (remove_mask & REMOVE_DOWNLOADS) { | 89 if (remove_mask & REMOVE_DOWNLOADS) { |
90 UserMetrics::RecordAction(L"ClearBrowsingData_Downloads", profile_); | 90 UserMetrics::RecordAction(L"ClearBrowsingData_Downloads", profile_); |
91 DownloadManager* download_manager = profile_->GetDownloadManager(); | 91 DownloadManager* download_manager = profile_->GetDownloadManager(); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 if (delete_begin.is_null()) | 205 if (delete_begin.is_null()) |
206 cache->DoomAllEntries(); | 206 cache->DoomAllEntries(); |
207 else | 207 else |
208 cache->DoomEntriesBetween(delete_begin, delete_end); | 208 cache->DoomEntriesBetween(delete_begin, delete_end); |
209 } | 209 } |
210 | 210 |
211 // Notify the UI thread that we are done. | 211 // Notify the UI thread that we are done. |
212 ui_loop->PostTask(FROM_HERE, NewRunnableMethod( | 212 ui_loop->PostTask(FROM_HERE, NewRunnableMethod( |
213 this, &BrowsingDataRemover::ClearedCache)); | 213 this, &BrowsingDataRemover::ClearedCache)); |
214 } | 214 } |
OLD | NEW |