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

Unified Diff: chrome/browser/tab_menu_model.cc

Issue 1725006: Changes the tab menu to use pin and unpin instead of a check. The mac (Closed)
Patch Set: Merged with tip of tree and updated unit tests Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/tab_menu_model.h ('k') | chrome/browser/tab_menu_model_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_menu_model.cc
diff --git a/chrome/browser/tab_menu_model.cc b/chrome/browser/tab_menu_model.cc
index d2b38cefed21af7f1ee7e97424c684e23136418c..bb0ba34bee5d511d681f73527534723ef6613b4e 100644
--- a/chrome/browser/tab_menu_model.cc
+++ b/chrome/browser/tab_menu_model.cc
@@ -4,30 +4,24 @@
#include "chrome/browser/tab_menu_model.h"
-#include "chrome/browser/defaults.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "grit/generated_resources.h"
-TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate)
+TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate,
+ bool is_pinned)
: menus::SimpleMenuModel(delegate) {
- Build();
+ Build(is_pinned);
}
-void TabMenuModel::Build() {
+void TabMenuModel::Build(bool is_pinned) {
AddItemWithStringId(TabStripModel::CommandNewTab, IDS_TAB_CXMENU_NEWTAB);
AddSeparator();
AddItemWithStringId(TabStripModel::CommandReload, IDS_TAB_CXMENU_RELOAD);
AddItemWithStringId(TabStripModel::CommandDuplicate,
IDS_TAB_CXMENU_DUPLICATE);
- // On Mac the HIG prefers "pin/unpin" to a checkmark. The Mac code will fix up
- // the actual string based on the tab's state via the delegate.
-#if defined(OS_MACOSX)
- AddItemWithStringId(TabStripModel::CommandTogglePinned,
- IDS_TAB_CXMENU_PIN_TAB);
-#else
- AddCheckItemWithStringId(TabStripModel::CommandTogglePinned,
- IDS_TAB_CXMENU_PIN_TAB);
-#endif
+ AddItemWithStringId(
+ TabStripModel::CommandTogglePinned,
+ is_pinned ? IDS_TAB_CXMENU_UNPIN_TAB : IDS_TAB_CXMENU_PIN_TAB);
AddSeparator();
AddItemWithStringId(TabStripModel::CommandCloseTab,
IDS_TAB_CXMENU_CLOSETAB);
« no previous file with comments | « chrome/browser/tab_menu_model.h ('k') | chrome/browser/tab_menu_model_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698