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

Unified Diff: chrome/browser/tabs/tab_strip_model.cc

Issue 391036: Forbid reloading the Inspector window (Closed)
Patch Set: Follow codereview Created 11 years 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
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:

Powered by Google App Engine
This is Rietveld 408576698