| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/panels/panel_stack_window_cocoa.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #import "chrome/browser/ui/cocoa/panels/panel_cocoa.h" | 9 #import "chrome/browser/ui/cocoa/panels/panel_cocoa.h" |
| 10 #import "chrome/browser/ui/cocoa/panels/panel_utils_cocoa.h" | 10 #import "chrome/browser/ui/cocoa/panels/panel_utils_cocoa.h" |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 286 } | 286 } |
| 287 bounds_updates_.clear(); | 287 bounds_updates_.clear(); |
| 288 | 288 |
| 289 delegate_->PanelBoundsBatchUpdateCompleted(); | 289 delegate_->PanelBoundsBatchUpdateCompleted(); |
| 290 } | 290 } |
| 291 | 291 |
| 292 void PanelStackWindowCocoa::Minimize() { | 292 void PanelStackWindowCocoa::Minimize() { |
| 293 // Provide the custom miniwindow image since there is nothing painted for | 293 // Provide the custom miniwindow image since there is nothing painted for |
| 294 // the background stack window. | 294 // the background stack window. |
| 295 gfx::Size stack_window_size = GetStackWindowBounds().size(); | 295 gfx::Size stack_window_size = GetStackWindowBounds().size(); |
| 296 gfx::Canvas canvas(stack_window_size, ui::SCALE_FACTOR_100P, true); | 296 gfx::Canvas canvas(stack_window_size, 1.0f, true); |
| 297 int y = 0; | 297 int y = 0; |
| 298 Panels::const_iterator iter = panels_.begin(); | 298 Panels::const_iterator iter = panels_.begin(); |
| 299 for (; iter != panels_.end(); ++iter) { | 299 for (; iter != panels_.end(); ++iter) { |
| 300 Panel* panel = *iter; | 300 Panel* panel = *iter; |
| 301 gfx::Rect snapshot_bounds = gfx::Rect(panel->GetBounds().size()); | 301 gfx::Rect snapshot_bounds = gfx::Rect(panel->GetBounds().size()); |
| 302 std::vector<unsigned char> png; | 302 std::vector<unsigned char> png; |
| 303 if (!chrome::GrabWindowSnapshotForUser(panel->GetNativeWindow(), | 303 if (!chrome::GrabWindowSnapshotForUser(panel->GetNativeWindow(), |
| 304 &png, | 304 &png, |
| 305 snapshot_bounds)) { | 305 snapshot_bounds)) { |
| 306 break; | 306 break; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater | 372 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater |
| 373 styleMask:NSBorderlessWindowMask | 373 styleMask:NSBorderlessWindowMask |
| 374 backing:NSBackingStoreBuffered | 374 backing:NSBackingStoreBuffered |
| 375 defer:NO]); | 375 defer:NO]); |
| 376 [window_ setBackgroundColor:[NSColor clearColor]]; | 376 [window_ setBackgroundColor:[NSColor clearColor]]; |
| 377 [window_ setHasShadow:YES]; | 377 [window_ setHasShadow:YES]; |
| 378 [window_ setLevel:NSNormalWindowLevel]; | 378 [window_ setLevel:NSNormalWindowLevel]; |
| 379 [window_ orderFront:nil]; | 379 [window_ orderFront:nil]; |
| 380 [window_ setTitle:base::SysUTF16ToNSString(delegate_->GetTitle())]; | 380 [window_ setTitle:base::SysUTF16ToNSString(delegate_->GetTitle())]; |
| 381 } | 381 } |
| OLD | NEW |