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

Unified Diff: chrome/browser/cocoa/tab_controller.mm

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/app/generated_resources.grd ('k') | chrome/browser/gtk/tabs/tab_gtk.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/tab_controller.mm
diff --git a/chrome/browser/cocoa/tab_controller.mm b/chrome/browser/cocoa/tab_controller.mm
index cb997d0febe8dec1fb479cd0cbaddcf28e5fe8ef..f2f76db7f2a2646732a68f4584768e20f4d07779 100644
--- a/chrome/browser/cocoa/tab_controller.mm
+++ b/chrome/browser/cocoa/tab_controller.mm
@@ -28,7 +28,8 @@ namespace TabControllerInternal {
class MenuDelegate : public menus::SimpleMenuModel::Delegate {
public:
explicit MenuDelegate(id<TabControllerTarget> target, TabController* owner)
- : target_(target), owner_(owner) { }
+ : target_(target),
+ owner_(owner) {}
// Overridden from menus::SimpleMenuModel::Delegate
virtual bool IsCommandIdChecked(int command_id) const { return false; }
@@ -46,20 +47,6 @@ class MenuDelegate : public menus::SimpleMenuModel::Delegate {
[target_ commandDispatch:command forController:owner_];
}
- virtual bool IsLabelForCommandIdDynamic(int command_id) const {
- return command_id == TabStripModel::CommandTogglePinned;
- }
- virtual string16 GetLabelForCommandId(int command_id) const {
- // Display "Pin Tab" when the tab is not pinned and "Unpin Tab" when it is
- // (this is not a checkmark menu item, per Apple's HIG).
- if (command_id == TabStripModel::CommandTogglePinned) {
- return l10n_util::GetStringUTF16(
- [owner_ mini] ? IDS_TAB_CXMENU_UNPIN_TAB_MAC
- : IDS_TAB_CXMENU_PIN_TAB_MAC);
- }
- return string16();
- }
-
private:
id<TabControllerTarget> target_; // weak
TabController* owner_; // weak, owns me
@@ -138,7 +125,9 @@ class MenuDelegate : public menus::SimpleMenuModel::Delegate {
- (NSMenu*)menu {
contextMenuDelegate_.reset(
new TabControllerInternal::MenuDelegate(target_, self));
- contextMenuModel_.reset(new TabMenuModel(contextMenuDelegate_.get()));
+ // TODO(42339): this is wrong, it should use pinned, not mini.
+ contextMenuModel_.reset(new TabMenuModel(contextMenuDelegate_.get(),
+ [self mini]));
contextMenuController_.reset(
[[MenuController alloc] initWithModel:contextMenuModel_.get()
useWithPopUpButtonCell:NO]);
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/gtk/tabs/tab_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698