summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 16:41:26 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 16:41:26 +0000
commit89e29d25efa776ed1f564e576d764fd3e9ddecfc (patch)
tree745cbd377db7daad70da6cc11428d84afeff180d /chrome/browser
parent3590cafaa8bd95d6b4e6f661e45bddc6c94688cc (diff)
downloadchromium_src-89e29d25efa776ed1f564e576d764fd3e9ddecfc.zip
chromium_src-89e29d25efa776ed1f564e576d764fd3e9ddecfc.tar.gz
chromium_src-89e29d25efa776ed1f564e576d764fd3e9ddecfc.tar.bz2
[Mac] Remove inappropriate checks on |preview_enabled|.
|LocationBarViewMac::PageActionImageView::UpdateVisibility()| updates |visible_| based on |preview_enabled|. It is called immediately after |preview_enabled| is set. This means that the only case where |IsVisible()| is false but |preview_enabled| is true will be the unit test which contrives that situation to exist. BUG=none TEST=none Review URL: http://codereview.chromium.org/1511001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42952 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/cocoa/autocomplete_text_field_cell.mm4
-rw-r--r--chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm8
2 files changed, 2 insertions, 10 deletions
diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell.mm b/chrome/browser/cocoa/autocomplete_text_field_cell.mm
index 5bae9867..ecc00b8 100644
--- a/chrome/browser/cocoa/autocomplete_text_field_cell.mm
+++ b/chrome/browser/cocoa/autocomplete_text_field_cell.mm
@@ -307,7 +307,7 @@ CGFloat WidthForKeyword(NSAttributedString* keywordString) {
// When this method is called, all the icon images are still loading, so
// just check to see whether the view is visible when deciding whether
// its NSRect should be made available.
- if (!view->preview_enabled() && !view->IsVisible())
+ if (!view->IsVisible())
return NSZeroRect;
for (AutocompleteTextFieldIcon* icon in [self layedOutIcons:cellFrame]) {
@@ -416,7 +416,7 @@ CGFloat WidthForKeyword(NSAttributedString* keywordString) {
for (size_t i = 0; i < pageActionCount; ++i) {
LocationBarViewMac::PageActionImageView* view =
page_action_views_->ViewAt(i);
- if (view->preview_enabled() || view->IsVisible()) {
+ if (view->IsVisible()) {
// If this function is called right after a page action icon has been
// created, the images for all views will still be loading; in this case,
// each visible view will give us its default size.
diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm b/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm
index 9b3e6b6..c400162 100644
--- a/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm
+++ b/chrome/browser/cocoa/autocomplete_text_field_cell_unittest.mm
@@ -371,14 +371,6 @@ TEST_F(AutocompleteTextFieldCellTest, PageActionImageFrame) {
EXPECT_TRUE(NSIsEmptyRect([cell pageActionFrameForIndex:0 inFrame:bounds]));
EXPECT_TRUE(NSIsEmptyRect([cell pageActionFrameForIndex:1 inFrame:bounds]));
- // Test preview page actions, as used by the extension installed bubble.
- TestPageActionImageView preview_view;
- list.Add(&preview_view);
- EXPECT_TRUE(NSIsEmptyRect([cell pageActionFrameForIndex:2 inFrame:bounds]));
- preview_view.set_preview_enabled(true);
- EXPECT_FALSE(NSIsEmptyRect([cell pageActionFrameForIndex:2 inFrame:bounds]));
- preview_view.set_preview_enabled(false);
-
// One page action, no security icon.
page_action_view.SetVisible(true);
NSRect iconRect0 = [cell pageActionFrameForIndex:0 inFrame:bounds];