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

Unified Diff: chrome/browser/ui/views/ash/screenshot_taker.cc

Issue 10692110: screenshot disabling policy (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed comments (2), hooking into GrabWindowSnapshot instead of ChromeShellDelegate, rebased on … 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/ui/views/ash/screenshot_taker.cc
diff --git a/chrome/browser/ui/views/ash/screenshot_taker.cc b/chrome/browser/ui/views/ash/screenshot_taker.cc
index 9549e2c964b6939ee9d18296c559c61aa3bc6e39..ac09d39b512acd39ed8acb443ec3c7ffabe842ad 100644
--- a/chrome/browser/ui/views/ash/screenshot_taker.cc
+++ b/chrome/browser/ui/views/ash/screenshot_taker.cc
@@ -18,6 +18,7 @@
#include "base/memory/ref_counted_memory.h"
#include "base/stringprintf.h"
#include "base/time.h"
+#include "chrome/browser/browser_process.h"
#include "chrome/browser/download/download_prefs.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -113,6 +114,11 @@ bool GrabWindowSnapshot(aura::Window* window,
const gfx::Rect& snapshot_bounds,
std::vector<unsigned char>* png_data) {
#if defined(OS_LINUX)
+ // browser::GrabWindowSnapshot checks this too, but RootWindow::GrabSnapshot
+ // does not. The statement below is only to support linux-specific XGetImage
+ // optimization.
+ if (g_browser_process->local_state()->GetBoolean(prefs::kDisableScreenshots))
+ return false;
Mattias Nissler (ping if slow) 2012/07/12 08:59:32 add blank line before comment
qfel 2012/07/12 14:48:06 Done.
// We use XGetImage() for Linux/ChromeOS for performance reasons.
// See crbug.com/119492
// TODO(mukai): remove this when the performance issue has been fixed.

Powered by Google App Engine
This is Rietveld 408576698