| 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/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 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 DCHECK(window_items_idx >= 0 && | 306 DCHECK(window_items_idx >= 0 && |
| 307 window_items_idx < static_cast<int>(local_window_items_.size())); | 307 window_items_idx < static_cast<int>(local_window_items_.size())); |
| 308 UMA_HISTOGRAM_ENUMERATION("WrenchMenu.RecentTabsSubMenu", RESTORE_WINDOW, | 308 UMA_HISTOGRAM_ENUMERATION("WrenchMenu.RecentTabsSubMenu", RESTORE_WINDOW, |
| 309 LIMIT_RECENT_TAB_ACTION); | 309 LIMIT_RECENT_TAB_ACTION); |
| 310 service->RestoreEntryById(delegate, local_window_items_[window_items_idx], | 310 service->RestoreEntryById(delegate, local_window_items_[window_items_idx], |
| 311 browser_->host_desktop_type(), disposition); | 311 browser_->host_desktop_type(), disposition); |
| 312 } | 312 } |
| 313 } | 313 } |
| 314 } | 314 } |
| 315 | 315 |
| 316 // static |
| 317 int RecentTabsSubMenuModel::GetFirstRecentTabsCommandId() { |
| 318 return WindowVectorIndexToCommandId(0); |
| 319 } |
| 320 |
| 316 const gfx::FontList* RecentTabsSubMenuModel::GetLabelFontListAt( | 321 const gfx::FontList* RecentTabsSubMenuModel::GetLabelFontListAt( |
| 317 int index) const { | 322 int index) const { |
| 318 int command_id = GetCommandIdAt(index); | 323 int command_id = GetCommandIdAt(index); |
| 319 if (command_id == kRecentlyClosedHeaderCommandId || | 324 if (command_id == kRecentlyClosedHeaderCommandId || |
| 320 IsDeviceNameCommandId(command_id)) { | 325 IsDeviceNameCommandId(command_id)) { |
| 321 return &ui::ResourceBundle::GetSharedInstance().GetFontList( | 326 return &ui::ResourceBundle::GetSharedInstance().GetFontList( |
| 322 ui::ResourceBundle::BoldFont); | 327 ui::ResourceBundle::BoldFont); |
| 323 } | 328 } |
| 324 return NULL; | 329 return NULL; |
| 325 } | 330 } |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 | 685 |
| 681 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate(); | 686 ui::MenuModelDelegate* menu_model_delegate = GetMenuModelDelegate(); |
| 682 if (menu_model_delegate) | 687 if (menu_model_delegate) |
| 683 menu_model_delegate->OnMenuStructureChanged(); | 688 menu_model_delegate->OnMenuStructureChanged(); |
| 684 } | 689 } |
| 685 | 690 |
| 686 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed( | 691 void RecentTabsSubMenuModel::TabRestoreServiceDestroyed( |
| 687 TabRestoreService* service) { | 692 TabRestoreService* service) { |
| 688 TabRestoreServiceChanged(service); | 693 TabRestoreServiceChanged(service); |
| 689 } | 694 } |
| OLD | NEW |