summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandresantoso@chromium.org <andresantoso@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 22:22:31 +0000
committerandresantoso@chromium.org <andresantoso@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-17 22:22:31 +0000
commit426ccf89ffc1cb33f0929d1869944c933817acc6 (patch)
treed23d15afe450c0b69b1e3021f787f4d27c714d4f
parent8c68557a6ae1a1cfac75dd258fe30d7baa66fbab (diff)
downloadchromium_src-426ccf89ffc1cb33f0929d1869944c933817acc6.zip
chromium_src-426ccf89ffc1cb33f0929d1869944c933817acc6.tar.gz
chromium_src-426ccf89ffc1cb33f0929d1869944c933817acc6.tar.bz2
Mac: Fix hidden find bar preventing context menu from appearing.
When the find bar is hidden, there is still an invisible view (its superview) in its place that was consuming the right-click event. Fixed this by hiding the find bar superview instead. Also make sure that the initial state is set to hidden. TEST=Invoke find bar then close it, right-click where the find bar was, context menu should appear. BUG=381207 Review URL: https://codereview.chromium.org/332283002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277883 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm7
-rw-r--r--chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm3
2 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
index b328234..6433c73 100644
--- a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
+++ b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller.mm
@@ -113,6 +113,7 @@ const float kRightEdgeOffset = 25;
[findBarView_ setFrame:[self hiddenFindBarFrame]];
defaultWidth_ = NSWidth([findBarView_ frame]);
+ [[self view] setHidden:YES];
[self prepopulateText:[[FindPasteboard sharedInstance] findText]];
}
@@ -449,7 +450,7 @@ const float kRightEdgeOffset = 25;
// If the find bar is not visible, make it actually hidden, so it'll no longer
// respond to key events.
- [findBarView_ setHidden:![self isFindBarVisible]];
+ [[self view] setHidden:![self isFindBarVisible]];
[[self browserWindowController] onFindBarVisibilityChanged];
}
@@ -505,7 +506,7 @@ const float kRightEdgeOffset = 25;
if (!animate) {
[findBarView_ setFrame:endFrame];
- [findBarView_ setHidden:![self isFindBarVisible]];
+ [[self view] setHidden:![self isFindBarVisible]];
[[self browserWindowController] onFindBarVisibilityChanged];
showHideAnimation_.reset(nil);
return;
@@ -513,7 +514,7 @@ const float kRightEdgeOffset = 25;
// If animating, ensure that the find bar is not hidden. Hidden status will be
// updated at the end of the animation.
- [findBarView_ setHidden:NO];
+ [[self view] setHidden:NO];
//[[self browserWindowController] onFindBarVisibilityChanged];
// Reset the frame to what was saved above.
diff --git a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm
index 1c31a43..28124c4 100644
--- a/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/find_bar/find_bar_cocoa_controller_unittest.mm
@@ -63,14 +63,17 @@ TEST_F(FindBarCocoaControllerTest, ShowAndHide) {
ASSERT_GT([findBarView frame].origin.y, 0);
ASSERT_FALSE([controller_ isFindBarVisible]);
+ ASSERT_TRUE([[controller_ view] isHidden]);
[controller_ showFindBar:NO];
EXPECT_EQ([findBarView frame].origin.y, 0);
EXPECT_TRUE([controller_ isFindBarVisible]);
+ ASSERT_FALSE([[controller_ view] isHidden]);
[controller_ hideFindBar:NO];
EXPECT_GT([findBarView frame].origin.y, 0);
EXPECT_FALSE([controller_ isFindBarVisible]);
+ ASSERT_TRUE([[controller_ view] isHidden]);
}
TEST_F(FindBarCocoaControllerTest, SetFindText) {