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

Unified Diff: chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm

Issue 132203004: Remove window_snapshot.* (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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/prefs/browser_prefs.cc ('k') | chrome/browser/ui/window_snapshot/window_snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm
diff --git a/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm b/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm
index a4601eb2da3af5549163a89cec4071d1059c8f47..394281f75f5c3d41412df90b8534906f693485e2 100644
--- a/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm
+++ b/chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.mm
@@ -290,6 +290,11 @@ void PanelStackWindowCocoa::BoundsUpdateAnimationEnded() {
}
void PanelStackWindowCocoa::Minimize() {
+ if (!g_browser_process->local_state()->GetBoolean(
+ prefs::kDisableScreenshots)) {
+ [window_ miniaturize:nil];
+ return;
+ }
// Provide the custom miniwindow image since there is nothing painted for
// the background stack window.
gfx::Size stack_window_size = GetStackWindowBounds().size();
@@ -300,11 +305,8 @@ void PanelStackWindowCocoa::Minimize() {
Panel* panel = *iter;
gfx::Rect snapshot_bounds = gfx::Rect(panel->GetBounds().size());
std::vector<unsigned char> png;
- if (!chrome::GrabWindowSnapshotForUser(panel->GetNativeWindow(),
- &png,
- snapshot_bounds)) {
+ if (ui::GrabWindowSnapshot(panel->GetNativeWindow(), &png, snapshot_bounds))
jianli 2014/01/10 00:47:37 Should we break out for loop when the function ret
enne (OOO) 2014/01/10 01:29:38 I don't know this code very well. Breaking out of
break;
- }
gfx::Image snapshot_image = gfx::Image::CreateFrom1xPNGBytes(
&(png[0]), png.size());
canvas.DrawImageInt(snapshot_image.AsImageSkia(), 0, y);
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/ui/window_snapshot/window_snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698