OLD | NEW |
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/ntp_snippets/download_suggestions_provider.h" | 5 #include "chrome/browser/ntp_snippets/download_suggestions_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/feature_list.h" | 11 #include "base/feature_list.h" |
12 #include "base/guid.h" | 12 #include "base/guid.h" |
13 #include "base/memory/ptr_util.h" | 13 #include "base/memory/ptr_util.h" |
14 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
15 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "base/threading/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
20 #include "chrome/common/chrome_features.h" | 20 #include "chrome/common/chrome_features.h" |
21 #include "chrome/grit/generated_resources.h" | 21 #include "chrome/grit/generated_resources.h" |
22 #include "components/ntp_snippets/features.h" | 22 #include "components/ntp_snippets/features.h" |
23 #include "components/ntp_snippets/pref_names.h" | 23 #include "components/ntp_snippets/pref_names.h" |
24 #include "components/ntp_snippets/pref_util.h" | 24 #include "components/ntp_snippets/pref_util.h" |
25 #include "components/offline_pages/offline_page_model_query.h" | 25 #include "components/offline_pages/core/offline_page_model_query.h" |
26 #include "components/prefs/pref_registry_simple.h" | 26 #include "components/prefs/pref_registry_simple.h" |
27 #include "components/prefs/pref_service.h" | 27 #include "components/prefs/pref_service.h" |
28 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
29 #include "ui/gfx/image/image.h" | 29 #include "ui/gfx/image/image.h" |
30 | 30 |
31 using content::DownloadItem; | 31 using content::DownloadItem; |
32 using content::DownloadManager; | 32 using content::DownloadManager; |
33 using ntp_snippets::Category; | 33 using ntp_snippets::Category; |
34 using ntp_snippets::CategoryInfo; | 34 using ntp_snippets::CategoryInfo; |
35 using ntp_snippets::CategoryStatus; | 35 using ntp_snippets::CategoryStatus; |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 | 715 |
716 void DownloadSuggestionsProvider::UnregisterDownloadItemObservers() { | 716 void DownloadSuggestionsProvider::UnregisterDownloadItemObservers() { |
717 DCHECK_NE(download_manager_, nullptr); | 717 DCHECK_NE(download_manager_, nullptr); |
718 | 718 |
719 std::vector<DownloadItem*> all_downloads; | 719 std::vector<DownloadItem*> all_downloads; |
720 download_manager_->GetAllDownloads(&all_downloads); | 720 download_manager_->GetAllDownloads(&all_downloads); |
721 | 721 |
722 for (DownloadItem* item : all_downloads) | 722 for (DownloadItem* item : all_downloads) |
723 item->RemoveObserver(this); | 723 item->RemoveObserver(this); |
724 } | 724 } |
OLD | NEW |