 Chromium Code Reviews
 Chromium Code Reviews Issue 2698613003:
  Don't use bold text for the "no recently closed tabs" menu item.  (Closed)
    
  
    Issue 2698613003:
  Don't use bold text for the "no recently closed tabs" menu item.  (Closed) 
  | OLD | NEW | 
|---|---|
| 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/ui/views/toolbar/app_menu.h" | 5 #include "chrome/browser/ui/views/toolbar/app_menu.h" | 
| 6 | 6 | 
| 7 #include <stdint.h> | 7 #include <stdint.h> | 
| 8 | 8 | 
| 9 #include <algorithm> | 9 #include <algorithm> | 
| 10 #include <cmath> | 10 #include <cmath> | 
| (...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 850 | 850 | 
| 851 const gfx::FontList* AppMenu::GetLabelFontList(int command_id) const { | 851 const gfx::FontList* AppMenu::GetLabelFontList(int command_id) const { | 
| 852 if (IsRecentTabsCommand(command_id)) { | 852 if (IsRecentTabsCommand(command_id)) { | 
| 853 return recent_tabs_menu_model_delegate_->GetLabelFontListAt( | 853 return recent_tabs_menu_model_delegate_->GetLabelFontListAt( | 
| 854 ModelIndexFromCommandId(command_id)); | 854 ModelIndexFromCommandId(command_id)); | 
| 855 } | 855 } | 
| 856 return NULL; | 856 return NULL; | 
| 857 } | 857 } | 
| 858 | 858 | 
| 859 bool AppMenu::GetShouldUseNormalForegroundColor(int command_id) const { | 859 bool AppMenu::GetShouldUseNormalForegroundColor(int command_id) const { | 
| 860 return IsRecentTabsCommand(command_id); | 860 // Use the normal foreground color instead of the disabled color for the | 
| 861 // recent tab headers. Only the headers from that submenu have font lists. | |
| 862 return IsRecentTabsCommand(command_id) && GetLabelFontList(command_id); | |
| 
Evan Stade
2017/02/16 01:30:04
this may seem a little odd but it's what the code
 
msw
2017/02/16 01:54:00
Can we omit the recently closed item when there ar
 
Evan Stade
2017/02/16 02:36:25
I think it's better to show it but have it disable
 
msw
2017/02/16 04:18:08
Acknowledged.
 | |
| 861 } | 863 } | 
| 862 | 864 | 
| 863 base::string16 AppMenu::GetTooltipText(int command_id, | 865 base::string16 AppMenu::GetTooltipText(int command_id, | 
| 864 const gfx::Point& p) const { | 866 const gfx::Point& p) const { | 
| 865 return IsBookmarkCommand(command_id) ? | 867 return IsBookmarkCommand(command_id) ? | 
| 866 bookmark_menu_delegate_->GetTooltipText(command_id, p) : base::string16(); | 868 bookmark_menu_delegate_->GetTooltipText(command_id, p) : base::string16(); | 
| 867 } | 869 } | 
| 868 | 870 | 
| 869 bool AppMenu::IsTriggerableEvent(views::MenuItemView* menu, | 871 bool AppMenu::IsTriggerableEvent(views::MenuItemView* menu, | 
| 870 const ui::Event& e) { | 872 const ui::Event& e) { | 
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1234 0, | 1236 0, | 
| 1235 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 1237 BookmarkMenuDelegate::SHOW_PERMANENT_FOLDERS, | 
| 1236 BOOKMARK_LAUNCH_LOCATION_APP_MENU); | 1238 BOOKMARK_LAUNCH_LOCATION_APP_MENU); | 
| 1237 } | 1239 } | 
| 1238 | 1240 | 
| 1239 int AppMenu::ModelIndexFromCommandId(int command_id) const { | 1241 int AppMenu::ModelIndexFromCommandId(int command_id) const { | 
| 1240 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); | 1242 CommandIDToEntry::const_iterator ix = command_id_to_entry_.find(command_id); | 
| 1241 DCHECK(ix != command_id_to_entry_.end()); | 1243 DCHECK(ix != command_id_to_entry_.end()); | 
| 1242 return ix->second.second; | 1244 return ix->second.second; | 
| 1243 } | 1245 } | 
| OLD | NEW |