diff options
author | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 18:04:01 +0000 |
---|---|---|
committer | thomasvl@chromium.org <thomasvl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-05 18:04:01 +0000 |
commit | cbee62f04370694af7cfc18f70805d415ab5c412 (patch) | |
tree | 138411f94c1b308fd20b8988087a9f28feebd347 | |
parent | 0784bb9f201896bc333aef39e3f0a29621fe03bc (diff) | |
download | chromium_src-cbee62f04370694af7cfc18f70805d415ab5c412.zip chromium_src-cbee62f04370694af7cfc18f70805d415ab5c412.tar.gz chromium_src-cbee62f04370694af7cfc18f70805d415ab5c412.tar.bz2 |
[Mac] Change when we trigger a download shelf layout
As part of awakeFromNib a dangerous download would set it's state and trigger a layout grabbing the initial size before the proper localized text was loaded and the view sized. This made the item "stick" at the wrong size. Now setState: doesn't trigger a layout and instead only force a layout when the dangerous state is cleared.
BUG=28446,28705,32775
TEST=see bugs
Review URL: http://codereview.chromium.org/668161
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40747 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/cocoa/download_item_controller.mm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/download_item_controller.mm b/chrome/browser/cocoa/download_item_controller.mm index f20c548..cf0caf8 100644 --- a/chrome/browser/cocoa/download_item_controller.mm +++ b/chrome/browser/cocoa/download_item_controller.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -218,6 +218,10 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { - (void)clearDangerousMode { [self setState:kNormal]; + // The state change hide the dangerouse download view and is now showing the + // download progress view. This means the view is likely to be a different + // size, so trigger a shelf layout to fix up spacing. + [shelf_ layoutItems]; } - (BOOL)isDangerousMode { @@ -236,7 +240,9 @@ class DownloadShelfContextMenuMac : public DownloadShelfContextMenu { [progressView_ setHidden:YES]; [dangerousDownloadView_ setHidden:NO]; } - [shelf_ layoutItems]; + // NOTE: Do not relayout the shelf, as this could get called during initial + // setup of the the item, so the localized text and sizing might not have + // happened yet. } // Called after the current theme has changed. |