Index: chrome/browser/extensions/api/tabs/tabs.cc |
diff --git a/chrome/browser/extensions/api/tabs/tabs.cc b/chrome/browser/extensions/api/tabs/tabs.cc |
index 3d80a52e7ef640dd813a48194a717a80f717f276..14fed5b083be3b7f67468ffbdffc3b58b540a4fe 100644 |
--- a/chrome/browser/extensions/api/tabs/tabs.cc |
+++ b/chrome/browser/extensions/api/tabs/tabs.cc |
@@ -19,6 +19,7 @@ |
#include "base/string_util.h" |
#include "base/stringprintf.h" |
#include "base/utf_string_conversions.h" |
+#include "chrome/browser/browser_process.h" |
#include "chrome/browser/extensions/api/tabs/tabs_constants.h" |
#include "chrome/browser/extensions/extension_function_dispatcher.h" |
#include "chrome/browser/extensions/extension_function_util.h" |
@@ -30,6 +31,7 @@ |
#include "chrome/browser/extensions/extension_window_list.h" |
#include "chrome/browser/extensions/script_executor.h" |
#include "chrome/browser/prefs/incognito_mode_prefs.h" |
+#include "chrome/browser/prefs/pref_service.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/sessions/restore_tab_helper.h" |
#include "chrome/browser/translate/translate_tab_helper.h" |
@@ -1599,6 +1601,12 @@ bool CaptureVisibleTabFunction::GetTabToCapture( |
}; |
bool CaptureVisibleTabFunction::RunImpl() { |
+ PrefService* service = profile()->GetPrefs(); |
+ if (service->GetBoolean(prefs::kDisableScreenshots)) { |
+ error_ = keys::kScreenshotsDisabled; |
+ return false; |
+ } |
+ |
WebContents* web_contents = NULL; |
TabContents* tab_contents = NULL; |
if (!GetTabToCapture(&web_contents, &tab_contents)) |