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

Side by Side Diff: chrome/browser/ui/window_snapshot/window_snapshot.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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/window_snapshot/window_snapshot.h"
6
7 #include "base/logging.h"
8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/prefs/pref_service.h"
10 #include "chrome/common/pref_names.h"
11 #include "third_party/skia/include/core/SkBitmap.h"
12 #include "ui/aura/window.h"
13 #include "ui/compositor/compositor.h"
14 #include "ui/compositor/dip_util.h"
15 #include "ui/compositor/layer.h"
16 #include "ui/gfx/codec/png_codec.h"
17 #include "ui/gfx/rect.h"
Mattias Nissler (ping if slow) 2012/07/12 08:59:32 Please clean up the list of includes to contain on
qfel 2012/07/12 14:48:06 Done.
18
19 namespace browser {
20
21 // OS specific implementation part of GrabWindowSnapshot (defined in
22 // window_snapshot_*.cc).
23 bool GrabWindowSnapshotOS(gfx::NativeWindow window,
Mattias Nissler (ping if slow) 2012/07/12 08:59:32 I don't really like this name. Maybe keep the exis
qfel 2012/07/12 14:48:06 Done.
24 std::vector<unsigned char>* png_representation,
Mattias Nissler (ping if slow) 2012/07/12 08:59:32 indentation.
qfel 2012/07/12 14:48:06 Done.
25 const gfx::Rect& snapshot_bounds);
26
27 bool GrabWindowSnapshot(gfx::NativeWindow window,
28 std::vector<unsigned char>* png_representation,
29 const gfx::Rect& snapshot_bounds) {
30 #if defined(OS_CHROMEOS)
Mattias Nissler (ping if slow) 2012/07/12 08:59:32 should this really be OS_CHROMEOS only? What are t
qfel 2012/07/12 14:48:06 Now the policy fully works on every platform. Done
31 if (g_browser_process->local_state()->GetBoolean(prefs::kDisableScreenshots))
32 return false;
33 #endif
34 return GrabWindowSnapshotOS(window, png_representation, snapshot_bounds);
35 }
36
37 #if defined(OS_CHROMEOS)
38 void RegisterPrefs(PrefService* service) {
39 service->RegisterBooleanPref(prefs::kDisableScreenshots, false);
40 }
41 #endif
42
43 } // namespace browser
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698