OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 #import "chrome/browser/ui/cocoa/translate/translate_infobar_base.h" | 6 #import "chrome/browser/ui/cocoa/translate/translate_infobar_base.h" |
7 | 7 |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 [infoBarView_ setPostsFrameChangedNotifications:YES]; | 466 [infoBarView_ setPostsFrameChangedNotifications:YES]; |
467 [[NSNotificationCenter defaultCenter] | 467 [[NSNotificationCenter defaultCenter] |
468 addObserver:self | 468 addObserver:self |
469 selector:@selector(didChangeFrame:) | 469 selector:@selector(didChangeFrame:) |
470 name:NSViewFrameDidChangeNotification | 470 name:NSViewFrameDidChangeNotification |
471 object:infoBarView_]; | 471 object:infoBarView_]; |
472 // Show and place GUI elements. | 472 // Show and place GUI elements. |
473 [self updateState]; | 473 [self updateState]; |
474 } | 474 } |
475 | 475 |
| 476 - (void)infobarWillClose { |
| 477 [[optionsPopUp_ menu] cancelTracking]; |
| 478 [super infobarWillClose]; |
| 479 } |
| 480 |
476 - (void)adjustOptionsButtonSizeAndVisibilityForView:(NSView*)lastView { | 481 - (void)adjustOptionsButtonSizeAndVisibilityForView:(NSView*)lastView { |
477 [optionsPopUp_ setHidden:NO]; | 482 [optionsPopUp_ setHidden:NO]; |
478 [self rebuildOptionsMenu:NO]; | 483 [self rebuildOptionsMenu:NO]; |
479 [[optionsPopUp_ cell] setArrowPosition:NSPopUpArrowAtBottom]; | 484 [[optionsPopUp_ cell] setArrowPosition:NSPopUpArrowAtBottom]; |
480 [optionsPopUp_ sizeToFit]; | 485 [optionsPopUp_ sizeToFit]; |
481 | 486 |
482 MoveControl(closeButton_, optionsPopUp_, spaceBetweenControls_, false); | 487 MoveControl(closeButton_, optionsPopUp_, spaceBetweenControls_, false); |
483 if (!VerifyControlOrderAndSpacing(lastView, optionsPopUp_)) { | 488 if (!VerifyControlOrderAndSpacing(lastView, optionsPopUp_)) { |
484 [self rebuildOptionsMenu:YES]; | 489 [self rebuildOptionsMenu:YES]; |
485 NSRect oldFrame = [optionsPopUp_ frame]; | 490 NSRect oldFrame = [optionsPopUp_ frame]; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 return false; | 637 return false; |
633 } | 638 } |
634 previousControl = control; | 639 previousControl = control; |
635 } | 640 } |
636 | 641 |
637 return true; | 642 return true; |
638 } | 643 } |
639 | 644 |
640 @end // TranslateInfoBarControllerBase (TestingAPI) | 645 @end // TranslateInfoBarControllerBase (TestingAPI) |
641 | 646 |
OLD | NEW |