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

Unified Diff: chrome/browser/extensions/api/tabs/tabs.cc

Issue 10692110: screenshot disabling policy (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments Created 8 years, 5 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
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))

Powered by Google App Engine
This is Rietveld 408576698