| 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> |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 return suggestion_candidates; | 313 return suggestion_candidates; |
| 314 } | 314 } |
| 315 | 315 |
| 316 ContentSuggestion ForeignSessionsSuggestionsProvider::BuildSuggestion( | 316 ContentSuggestion ForeignSessionsSuggestionsProvider::BuildSuggestion( |
| 317 const SessionData& data) { | 317 const SessionData& data) { |
| 318 ContentSuggestion suggestion(provided_category_, | 318 ContentSuggestion suggestion(provided_category_, |
| 319 data.navigation->virtual_url().spec(), | 319 data.navigation->virtual_url().spec(), |
| 320 data.navigation->virtual_url()); | 320 data.navigation->virtual_url()); |
| 321 suggestion.set_title(data.navigation->title()); | 321 suggestion.set_title(data.navigation->title()); |
| 322 suggestion.set_publish_date(data.tab->timestamp); | 322 suggestion.set_publish_date(data.tab->timestamp); |
| 323 // TODO(skym): It's unclear if this simple approach is sufficient for | |
| 324 // right-to-left languages. | |
| 325 // This field is sandwiched between the url's favicon, which is on the left, | |
| 326 // and the |publish_date|, which is to the right. The domain should always | |
| 327 // appear next to the favicon. | |
| 328 suggestion.set_publisher_name( | 323 suggestion.set_publisher_name( |
| 329 base::UTF8ToUTF16(data.navigation->virtual_url().host() + " - " + | 324 base::UTF8ToUTF16(data.navigation->virtual_url().host())); |
| 330 data.session->session_name)); | |
| 331 return suggestion; | 325 return suggestion; |
| 332 } | 326 } |
| 333 | 327 |
| 334 } // namespace ntp_snippets | 328 } // namespace ntp_snippets |
| OLD | NEW |