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

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: Fixed Android and Mac builds 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
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs.h ('k') | chrome/browser/extensions/api/tabs/tabs_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cf8585a121b7a5fbefb82751ac4a94e1dcaf6b44..73749424f4cd4381b1edeec9df148fb692417f45 100644
--- a/chrome/browser/extensions/api/tabs/tabs.cc
+++ b/chrome/browser/extensions/api/tabs/tabs.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/extensions/window_controller.h"
#include "chrome/browser/extensions/window_controller_list.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"
@@ -1584,6 +1585,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))
@@ -1741,6 +1748,11 @@ void CaptureVisibleTabFunction::SendResultFromBitmap(
SendResponse(true);
}
+void CaptureVisibleTabFunction::RegisterUserPrefs(PrefService* service) {
+ service->RegisterBooleanPref(prefs::kDisableScreenshots, false,
+ PrefService::UNSYNCABLE_PREF);
+}
+
bool DetectTabLanguageFunction::RunImpl() {
int tab_id = 0;
Browser* browser = NULL;
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs.h ('k') | chrome/browser/extensions/api/tabs/tabs_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698