| 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 "components/ntp_snippets/sessions/foreign_sessions_suggestions_provider
.h" | 5 #include "components/ntp_snippets/sessions/foreign_sessions_suggestions_provider
.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <tuple> | 9 #include <tuple> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/strings/string_piece.h" | 12 #include "base/strings/string_piece.h" |
| 13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
| 14 #include "base/threading/thread_task_runner_handle.h" | 14 #include "base/threading/thread_task_runner_handle.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "components/ntp_snippets/category.h" | 16 #include "components/ntp_snippets/category.h" |
| 17 #include "components/ntp_snippets/category_info.h" | 17 #include "components/ntp_snippets/category_info.h" |
| 18 #include "components/ntp_snippets/content_suggestion.h" | 18 #include "components/ntp_snippets/content_suggestion.h" |
| 19 #include "components/ntp_snippets/features.h" | 19 #include "components/ntp_snippets/features.h" |
| 20 #include "components/ntp_snippets/pref_names.h" | 20 #include "components/ntp_snippets/pref_names.h" |
| 21 #include "components/ntp_snippets/pref_util.h" | 21 #include "components/ntp_snippets/pref_util.h" |
| 22 #include "components/prefs/pref_registry_simple.h" | 22 #include "components/prefs/pref_registry_simple.h" |
| 23 #include "components/prefs/pref_service.h" | 23 #include "components/prefs/pref_service.h" |
| 24 #include "components/sessions/core/session_types.h" | 24 #include "components/sessions/core/session_types.h" |
| 25 #include "components/strings/grit/components_strings.h" |
| 25 #include "components/sync_sessions/synced_session.h" | 26 #include "components/sync_sessions/synced_session.h" |
| 26 #include "components/variations/variations_associated_data.h" | 27 #include "components/variations/variations_associated_data.h" |
| 27 #include "grit/components_strings.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 #include "url/gurl.h" | 30 #include "url/gurl.h" |
| 31 | 31 |
| 32 using base::Time; | 32 using base::Time; |
| 33 using base::TimeDelta; | 33 using base::TimeDelta; |
| 34 using sessions::SerializedNavigationEntry; | 34 using sessions::SerializedNavigationEntry; |
| 35 using sessions::SessionTab; | 35 using sessions::SessionTab; |
| 36 using sessions::SessionWindow; | 36 using sessions::SessionWindow; |
| 37 using sync_sessions::SyncedSession; | 37 using sync_sessions::SyncedSession; |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 data.navigation->virtual_url().spec(), | 399 data.navigation->virtual_url().spec(), |
| 400 data.navigation->virtual_url()); | 400 data.navigation->virtual_url()); |
| 401 suggestion.set_title(data.navigation->title()); | 401 suggestion.set_title(data.navigation->title()); |
| 402 suggestion.set_publish_date(data.tab->timestamp); | 402 suggestion.set_publish_date(data.tab->timestamp); |
| 403 suggestion.set_publisher_name( | 403 suggestion.set_publisher_name( |
| 404 base::UTF8ToUTF16(data.navigation->virtual_url().host())); | 404 base::UTF8ToUTF16(data.navigation->virtual_url().host())); |
| 405 return suggestion; | 405 return suggestion; |
| 406 } | 406 } |
| 407 | 407 |
| 408 } // namespace ntp_snippets | 408 } // namespace ntp_snippets |
| OLD | NEW |