Chromium Code Reviews| Index: chrome/browser/tabs/tab_strip_model.cc |
| diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc |
| index ff179752fea59f75d815a3e6fc1fa5cd930f0820..c8920aa750a2b80e107cd3173180902309a4a047 100644 |
| --- a/chrome/browser/tabs/tab_strip_model.cc |
| +++ b/chrome/browser/tabs/tab_strip_model.cc |
| @@ -19,6 +19,7 @@ |
| #include "chrome/browser/tabs/tab_strip_model_order_controller.h" |
| #include "chrome/browser/tab_contents/navigation_controller.h" |
| #include "chrome/browser/tab_contents/tab_contents.h" |
| +#include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| #include "chrome/browser/tab_contents/tab_contents_view.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/notification_service.h" |
| @@ -500,9 +501,14 @@ bool TabStripModel::IsContextMenuCommandEnabled( |
| DCHECK(command_id > CommandFirst && command_id < CommandLast); |
| switch (command_id) { |
| case CommandNewTab: |
| - case CommandReload: |
| case CommandCloseTab: |
| return true; |
| + case CommandReload: |
| + if (TabContents* contents = GetTabContentsAt(context_index)) { |
|
pfeldman
2009/12/25 15:22:59
Do not use { } with single line statements.
pfeldman
2009/12/25 15:22:59
No need to check tab contents for being NULL.
|
| + return contents->delegate()->CanReloadContents(contents); |
| + } else { |
| + return false; |
| + } |
| case CommandCloseOtherTabs: |
| return count() > 1; |
| case CommandCloseTabsToRight: |