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

Side by Side Diff: chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.cc

Issue 1103293004: Use ICU plural syntax in more place (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: recently_closed.js restored per estade Created 5 years, 7 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
OLDNEW
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/ui/toolbar/recent_tabs_sub_menu_model.h" 5 #include "chrome/browser/ui/toolbar/recent_tabs_sub_menu_model.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/prefs/scoped_user_pref_update.h" 9 #include "base/prefs/scoped_user_pref_update.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 AddTabFavicon(command_id, item.url); 527 AddTabFavicon(command_id, item.url);
528 local_tab_navigation_items_.push_back(item); 528 local_tab_navigation_items_.push_back(item);
529 } 529 }
530 530
531 void RecentTabsSubMenuModel::BuildLocalWindowItem( 531 void RecentTabsSubMenuModel::BuildLocalWindowItem(
532 const SessionID::id_type& window_id, 532 const SessionID::id_type& window_id,
533 int num_tabs, 533 int num_tabs,
534 int curr_model_index) { 534 int curr_model_index) {
535 int command_id = WindowVectorIndexToCommandId(local_window_items_.size()); 535 int command_id = WindowVectorIndexToCommandId(local_window_items_.size());
536 // See comments in BuildLocalEntries() about usage of InsertItem*At(). 536 // See comments in BuildLocalEntries() about usage of InsertItem*At().
537 if (num_tabs == 1) { 537 InsertItemAt(curr_model_index, command_id, l10n_util::GetPluralStringFUTF16(
538 InsertItemWithStringIdAt(curr_model_index, command_id, 538 IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW, num_tabs));
539 IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_SINGLE);
540 } else {
541 InsertItemAt(curr_model_index, command_id, l10n_util::GetStringFUTF16(
542 IDS_NEW_TAB_RECENTLY_CLOSED_WINDOW_MULTIPLE,
543 base::IntToString16(num_tabs)));
544 }
545 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 539 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
546 SetIcon(curr_model_index, rb.GetNativeImageNamed(IDR_RECENTLY_CLOSED_WINDOW)); 540 SetIcon(curr_model_index, rb.GetNativeImageNamed(IDR_RECENTLY_CLOSED_WINDOW));
547 local_window_items_.push_back(window_id); 541 local_window_items_.push_back(window_id);
548 } 542 }
549 543
550 void RecentTabsSubMenuModel::BuildOtherDevicesTabItem( 544 void RecentTabsSubMenuModel::BuildOtherDevicesTabItem(
551 const std::string& session_tag, 545 const std::string& session_tag,
552 const sessions::SessionTab& tab) { 546 const sessions::SessionTab& tab) {
553 const sessions::SerializedNavigationEntry& current_navigation = 547 const sessions::SerializedNavigationEntry& current_navigation =
554 tab.navigations.at(tab.normalized_navigation_index()); 548 tab.navigations.at(tab.normalized_navigation_index());
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 689
696 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate(); 690 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate();
697 if (menu_model_delegate) 691 if (menu_model_delegate)
698 menu_model_delegate->OnMenuStructureChanged(); 692 menu_model_delegate->OnMenuStructureChanged();
699 } 693 }
700 694
701 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed( 695 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed(
702 TabRestoreService* service) { 696 TabRestoreService* service) {
703 TabRestoreServiceChanged(service); 697 TabRestoreServiceChanged(service);
704 } 698 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/history_menu_bridge.mm ('k') | chrome/browser/ui/views/download/download_in_progress_dialog_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698