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

Unified Diff: chrome/browser/gtk/tabs/tab_gtk.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/cocoa/tab_controller.mm ('k') | chrome/browser/tab_menu_model.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/gtk/tabs/tab_gtk.cc
diff --git a/chrome/browser/gtk/tabs/tab_gtk.cc b/chrome/browser/gtk/tabs/tab_gtk.cc
index 130b17a87e8cc3a3fb7384189ef715c92bb46d6c..c5f7201b41ae8cd9e6448ccfaf73330985fc331a 100644
--- a/chrome/browser/gtk/tabs/tab_gtk.cc
+++ b/chrome/browser/gtk/tabs/tab_gtk.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -39,7 +39,7 @@ class TabGtk::ContextMenuController : public menus::SimpleMenuModel::Delegate {
public:
explicit ContextMenuController(TabGtk* tab)
: tab_(tab),
- model_(this) {
+ model_(this, tab->delegate()->IsTabPinned(tab)) {
menu_.reset(new MenuGtk(NULL, &model_));
}
@@ -57,9 +57,7 @@ class TabGtk::ContextMenuController : public menus::SimpleMenuModel::Delegate {
private:
// 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(
@@ -348,8 +346,7 @@ void TabGtk::SetBounds(const gfx::Rect& bounds) {
// TabGtk, private:
void TabGtk::ShowContextMenu() {
- if (!menu_controller_.get())
- menu_controller_.reset(new ContextMenuController(this));
+ menu_controller_.reset(new ContextMenuController(this));
menu_controller_->RunMenu();
}
« no previous file with comments | « chrome/browser/cocoa/tab_controller.mm ('k') | chrome/browser/tab_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698