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

Side by Side Diff: chrome/browser/android/ntp/most_visited_sites.cc

Issue 1863393007: NTP: Fix "Undo" option of the "Item removed" snackbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/android/ntp/most_visited_sites.h" 5 #include "chrome/browser/android/ntp/most_visited_sites.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 617 matching lines...) Expand 10 before | Expand all | Expand 10 after
628 MostVisitedSites::SuggestionsVector whitelist_suggestions = 628 MostVisitedSites::SuggestionsVector whitelist_suggestions =
629 CreateWhitelistEntryPointSuggestions(*personal_suggestions); 629 CreateWhitelistEntryPointSuggestions(*personal_suggestions);
630 MostVisitedSites::SuggestionsVector popular_sites_suggestions = 630 MostVisitedSites::SuggestionsVector popular_sites_suggestions =
631 CreatePopularSitesSuggestions(*personal_suggestions, 631 CreatePopularSitesSuggestions(*personal_suggestions,
632 whitelist_suggestions); 632 whitelist_suggestions);
633 size_t num_actual_tiles = personal_suggestions->size() + 633 size_t num_actual_tiles = personal_suggestions->size() +
634 whitelist_suggestions.size() + 634 whitelist_suggestions.size() +
635 popular_sites_suggestions.size(); 635 popular_sites_suggestions.size();
636 std::vector<std::string> old_sites_url; 636 std::vector<std::string> old_sites_url;
637 std::vector<bool> old_sites_is_personal; 637 std::vector<bool> old_sites_is_personal;
638 GetPreviousNTPSites(num_actual_tiles, &old_sites_url, &old_sites_is_personal); 638 // TODO(treib): We used to call |GetPreviousNTPSites| here to populate
639 // |old_sites_url| and |old_sites_is_personal|, but that caused problems
640 // (crbug.com/585391). Either figure out a way to fix them and re-enable,
641 // or properly remove the order-persisting code. crbug.com/601734
639 MostVisitedSites::SuggestionsVector merged_suggestions = MergeSuggestions( 642 MostVisitedSites::SuggestionsVector merged_suggestions = MergeSuggestions(
640 personal_suggestions, &whitelist_suggestions, &popular_sites_suggestions, 643 personal_suggestions, &whitelist_suggestions, &popular_sites_suggestions,
641 old_sites_url, old_sites_is_personal); 644 old_sites_url, old_sites_is_personal);
642 DCHECK_EQ(num_actual_tiles, merged_suggestions.size()); 645 DCHECK_EQ(num_actual_tiles, merged_suggestions.size());
643 current_suggestions_.swap(merged_suggestions); 646 current_suggestions_.swap(merged_suggestions);
644 if (received_popular_sites_) 647 if (received_popular_sites_)
645 SaveCurrentNTPSites(); 648 SaveCurrentNTPSites();
646 } 649 }
647 650
648 // static 651 // static
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 } 871 }
869 } 872 }
870 873
871 static jlong Init(JNIEnv* env, 874 static jlong Init(JNIEnv* env,
872 const JavaParamRef<jobject>& obj, 875 const JavaParamRef<jobject>& obj,
873 const JavaParamRef<jobject>& jprofile) { 876 const JavaParamRef<jobject>& jprofile) {
874 MostVisitedSites* most_visited_sites = 877 MostVisitedSites* most_visited_sites =
875 new MostVisitedSites(ProfileAndroid::FromProfileAndroid(jprofile)); 878 new MostVisitedSites(ProfileAndroid::FromProfileAndroid(jprofile));
876 return reinterpret_cast<intptr_t>(most_visited_sites); 879 return reinterpret_cast<intptr_t>(most_visited_sites);
877 } 880 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698