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

Unified Diff: chrome/browser/views/tabs/tab.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_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tabs/tab.cc
diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc
index 3f3da3f412c4c2ef83e24482a332f79af3860464..eb80e89efdb165066bb9785adbdf71eb98e9a0fb 100644
--- a/chrome/browser/views/tabs/tab.cc
+++ b/chrome/browser/views/tabs/tab.cc
@@ -29,7 +29,8 @@ static const SkScalar kTabBottomCurveWidth = 3;
class Tab::TabContextMenuContents : public menus::SimpleMenuModel::Delegate {
public:
explicit TabContextMenuContents(Tab* tab)
- : ALLOW_THIS_IN_INITIALIZER_LIST(model_(this)),
+ : ALLOW_THIS_IN_INITIALIZER_LIST(
+ model_(this, tab->delegate()->IsTabPinned(tab))),
tab_(tab),
last_command_(TabStripModel::CommandFirst) {
Build();
@@ -51,9 +52,7 @@ class Tab::TabContextMenuContents : public menus::SimpleMenuModel::Delegate {
// Overridden from menus::SimpleMenuModel::Delegate:
virtual bool IsCommandIdChecked(int command_id) const {
- if (!tab_ || command_id != TabStripModel::CommandTogglePinned)
- return false;
- return tab_->delegate()->IsTabPinned(tab_);
+ return false;
}
virtual bool IsCommandIdEnabled(int command_id) const {
return tab_ && tab_->delegate()->IsCommandEnabledForTab(
@@ -202,8 +201,7 @@ bool Tab::GetAccessibleRole(AccessibilityTypes::Role* role) {
void Tab::ShowContextMenu(views::View* source,
const gfx::Point& p,
bool is_mouse_gesture) {
- if (!context_menu_contents_.get())
- context_menu_contents_.reset(new TabContextMenuContents(this));
+ context_menu_contents_.reset(new TabContextMenuContents(this));
context_menu_contents_->RunMenuAt(p);
}
« no previous file with comments | « chrome/browser/tab_menu_model_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698