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

Side by Side Diff: chrome/browser/cocoa/status_bubble_mac.mm

Issue 460101: Mac: fix problem with un-minimizing windows using the app icon in the Dock. (Closed)
Patch Set: Created 11 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/cocoa/status_bubble_mac.h" 5 #include "chrome/browser/cocoa/status_bubble_mac.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "app/gfx/text_elider.h" 9 #include "app/gfx/text_elider.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 void StatusBubbleMac::Attach() { 343 void StatusBubbleMac::Attach() {
344 // This method may be called several times during the process of creating or 344 // This method may be called several times during the process of creating or
345 // showing a status bubble to attach the bubble to its parent window. 345 // showing a status bubble to attach the bubble to its parent window.
346 if (!is_attached()) 346 if (!is_attached())
347 [parent_ addChildWindow:window_ ordered:NSWindowAbove]; 347 [parent_ addChildWindow:window_ ordered:NSWindowAbove];
348 } 348 }
349 349
350 void StatusBubbleMac::Detach() { 350 void StatusBubbleMac::Detach() {
351 // This method may be called several times in the process of hiding or 351 // This method may be called several times in the process of hiding or
352 // destroying a status bubble. 352 // destroying a status bubble.
353 if (is_attached()) 353 if (is_attached()) {
354 [parent_ removeChildWindow:window_]; 354 [parent_ removeChildWindow:window_]; // See crbug.com/28107 ...
355 [window_ orderOut:nil]; // ... and crbug.com/29054.
356 }
355 } 357 }
356 358
357 void StatusBubbleMac::AnimationDidStop(CAAnimation* animation, bool finished) { 359 void StatusBubbleMac::AnimationDidStop(CAAnimation* animation, bool finished) {
358 DCHECK([NSThread isMainThread]); 360 DCHECK([NSThread isMainThread]);
359 DCHECK(state_ == kBubbleShowingFadeIn || state_ == kBubbleHidingFadeOut); 361 DCHECK(state_ == kBubbleShowingFadeIn || state_ == kBubbleHidingFadeOut);
360 DCHECK(is_attached()); 362 DCHECK(is_attached());
361 363
362 if (finished) { 364 if (finished) {
363 // Because of the mechanism used to interrupt animations, this is never 365 // Because of the mechanism used to interrupt animations, this is never
364 // actually called with finished set to false. If animations ever become 366 // actually called with finished set to false. If animations ever become
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 } 534 }
533 535
534 NSRect StatusBubbleMac::CalculateWindowFrame() { 536 NSRect StatusBubbleMac::CalculateWindowFrame() {
535 DCHECK(parent_); 537 DCHECK(parent_);
536 538
537 NSRect rect = [parent_ frame]; 539 NSRect rect = [parent_ frame];
538 rect.size.height = kWindowHeight; 540 rect.size.height = kWindowHeight;
539 rect.size.width = static_cast<int>(kWindowWidthPercent * rect.size.width); 541 rect.size.width = static_cast<int>(kWindowWidthPercent * rect.size.width);
540 return rect; 542 return rect;
541 } 543 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698