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

Side by Side Diff: chrome/browser/ui/cocoa/translate/translate_infobar_base.mm

Issue 6296003: Mac: Fix crash when clicking on zombie translate options menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/infobar_controller.mm ('k') | 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) 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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/infobar_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698