OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/jumplist_win.h" | 5 #include "chrome/browser/jumplist_win.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 profiles_or_most_visited_items += | 178 profiles_or_most_visited_items += |
179 recently_closed_items - recently_closed_pages.size(); | 179 recently_closed_items - recently_closed_pages.size(); |
180 recently_closed_items = recently_closed_pages.size(); | 180 recently_closed_items = recently_closed_pages.size(); |
181 } | 181 } |
182 } | 182 } |
183 | 183 |
184 // Update the "Most Visited" category of the JumpList if it exists. | 184 // Update the "Most Visited" category of the JumpList if it exists. |
185 // This update request is applied into the JumpList when we commit this | 185 // This update request is applied into the JumpList when we commit this |
186 // transaction. | 186 // transaction. |
187 if (!use_profiles_category && !jumplist_updater.AddCustomCategory( | 187 if (!use_profiles_category && !jumplist_updater.AddCustomCategory( |
188 base::UTF16ToWide( | 188 l10n_util::GetStringUTF16(IDS_NEW_TAB_MOST_VISITED), |
189 l10n_util::GetStringUTF16(IDS_NEW_TAB_MOST_VISITED)), | |
190 most_visited_pages, profiles_or_most_visited_items)) { | 189 most_visited_pages, profiles_or_most_visited_items)) { |
191 return false; | 190 return false; |
192 } | 191 } |
193 | 192 |
194 // Update the "Recently Closed" category of the JumpList. | 193 // Update the "Recently Closed" category of the JumpList. |
195 if (!jumplist_updater.AddCustomCategory( | 194 if (!jumplist_updater.AddCustomCategory( |
196 base::UTF16ToWide( | 195 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED), |
197 l10n_util::GetStringUTF16(IDS_NEW_TAB_RECENTLY_CLOSED)), | |
198 recently_closed_pages, recently_closed_items)) { | 196 recently_closed_pages, recently_closed_items)) { |
199 return false; | 197 return false; |
200 } | 198 } |
201 | 199 |
202 // Update the "People" category of the JumpList if it exists. Only display it | 200 // Update the "People" category of the JumpList if it exists. Only display it |
203 // if there's more than one profile available. | 201 // if there's more than one profile available. |
204 if (use_profiles_category && profile_switcher.size() > 1 && | 202 if (use_profiles_category && profile_switcher.size() > 1 && |
205 !jumplist_updater.AddCustomCategory( | 203 !jumplist_updater.AddCustomCategory( |
206 l10n_util::GetStringUTF16(IDS_PROFILES_OPTIONS_GROUP_NAME), | 204 l10n_util::GetStringUTF16(IDS_PROFILES_OPTIONS_GROUP_NAME), |
207 profile_switcher, profiles_or_most_visited_items)) { | 205 profile_switcher, profiles_or_most_visited_items)) { |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 | 602 |
605 void JumpList::TopSitesLoaded(history::TopSites* top_sites) { | 603 void JumpList::TopSitesLoaded(history::TopSites* top_sites) { |
606 } | 604 } |
607 | 605 |
608 void JumpList::TopSitesChanged(history::TopSites* top_sites) { | 606 void JumpList::TopSitesChanged(history::TopSites* top_sites) { |
609 top_sites->GetMostVisitedURLs( | 607 top_sites->GetMostVisitedURLs( |
610 base::Bind(&JumpList::OnMostVisitedURLsAvailable, | 608 base::Bind(&JumpList::OnMostVisitedURLsAvailable, |
611 weak_ptr_factory_.GetWeakPtr()), | 609 weak_ptr_factory_.GetWeakPtr()), |
612 false); | 610 false); |
613 } | 611 } |
OLD | NEW |