summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tabs
diff options
context:
space:
mode:
authorapavlov@chromium.org <apavlov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-25 11:22:46 +0000
committerapavlov@chromium.org <apavlov@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-25 11:22:46 +0000
commit8e48e9848e1a6626c36e3efbe1750bbb3c8b3e4e (patch)
tree344faabdd8f1fe715c6d919de4a1d53bde344dbb /chrome/browser/tabs
parent09c0077246c9be4122ca1fcbf892865a61ec12a8 (diff)
downloadchromium_src-8e48e9848e1a6626c36e3efbe1750bbb3c8b3e4e.zip
chromium_src-8e48e9848e1a6626c36e3efbe1750bbb3c8b3e4e.tar.gz
chromium_src-8e48e9848e1a6626c36e3efbe1750bbb3c8b3e4e.tar.bz2
Forbid reloading the Inspector window.
This CL disables reloading from the system menu, tab popup menu, and page context menu. BUG=27254,6902 TEST=none Review URL: http://codereview.chromium.org/391036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35275 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tabs')
-rw-r--r--chrome/browser/tabs/tab_strip_model.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc
index ff17975..c8920aa 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)) {
+ return contents->delegate()->CanReloadContents(contents);
+ } else {
+ return false;
+ }
case CommandCloseOtherTabs:
return count() > 1;
case CommandCloseTabsToRight: