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

Side by Side Diff: components/ntp_snippets/sessions/foreign_sessions_suggestions_provider.cc

Issue 2497343002: Updating foreign tabs suggestion's title and text. (Closed)
Patch Set: Created 4 years, 1 month 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
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 "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
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
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets_strings.grdp » ('j') | components/ntp_snippets_strings.grdp » ('J')

Powered by Google App Engine
This is Rietveld 408576698