OLD | NEW |
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/autocomplete/autocomplete_popup_view_mac.h" | 5 #include "chrome/browser/autocomplete/autocomplete_popup_view_mac.h" |
6 | 6 |
7 #include "app/gfx/text_elider.h" | 7 #include "app/gfx/text_elider.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
10 #include "base/gfx/rect.h" | 10 #include "base/gfx/rect.h" |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
409 PaintUpdatesNow(); | 409 PaintUpdatesNow(); |
410 | 410 |
411 // Animate the frame change if the only change is that the height got smaller. | 411 // Animate the frame change if the only change is that the height got smaller. |
412 // Otherwise, resize immediately. | 412 // Otherwise, resize immediately. |
413 NSRect oldFrame = [popup_ frame]; | 413 NSRect oldFrame = [popup_ frame]; |
414 if (r.size.height < oldFrame.size.height && | 414 if (r.size.height < oldFrame.size.height && |
415 r.origin.x == oldFrame.origin.x && | 415 r.origin.x == oldFrame.origin.x && |
416 r.size.width == oldFrame.size.width) { | 416 r.size.width == oldFrame.size.width) { |
417 [NSAnimationContext beginGrouping]; | 417 [NSAnimationContext beginGrouping]; |
418 [[NSAnimationContext currentContext] | 418 [[NSAnimationContext currentContext] |
419 gtm_setDuration:kShrinkAnimationDuration]; | 419 gtm_setDuration:kShrinkAnimationDuration |
| 420 eventMask:NSLeftMouseDownMask]; |
420 [[popup_ animator] setFrame:r display:YES]; | 421 [[popup_ animator] setFrame:r display:YES]; |
421 [NSAnimationContext endGrouping]; | 422 [NSAnimationContext endGrouping]; |
422 } else { | 423 } else { |
423 [popup_ setFrame:r display:YES]; | 424 [popup_ setFrame:r display:YES]; |
424 } | 425 } |
425 | 426 |
426 if (!IsOpen()) { | 427 if (!IsOpen()) { |
427 [[field_ window] addChildWindow:popup_ ordered:NSWindowAbove]; | 428 [[field_ window] addChildWindow:popup_ ordered:NSWindowAbove]; |
428 } | 429 } |
429 } | 430 } |
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 yRadius:kPopupRoundingRadius]; | 710 yRadius:kPopupRoundingRadius]; |
710 | 711 |
711 // Draw the matrix clipped to our border. | 712 // Draw the matrix clipped to our border. |
712 [NSGraphicsContext saveGraphicsState]; | 713 [NSGraphicsContext saveGraphicsState]; |
713 [path addClip]; | 714 [path addClip]; |
714 [super drawRect:rect]; | 715 [super drawRect:rect]; |
715 [NSGraphicsContext restoreGraphicsState]; | 716 [NSGraphicsContext restoreGraphicsState]; |
716 } | 717 } |
717 | 718 |
718 @end | 719 @end |
OLD | NEW |