Commit 1025efbb authored by estade@chromium.org's avatar estade@chromium.org

rAc: revert 3 second dismissal immunity on generated card bubble

BUG=282671

Review URL: https://chromiumcodereview.appspot.com/23890011

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@221851 0039d316-1c4b-4281-b951-d872f2087c98
parent bc390155
......@@ -36,17 +36,6 @@ GeneratedCreditCardBubbleViews::~GeneratedCreditCardBubbleViews() {}
void GeneratedCreditCardBubbleViews::Show() {
views::BubbleDelegateView::CreateBubble(this)->Show();
// Grab mouse events for 3 seconds after showing. This prevents clicks outside
// of the bubble from dismissing the bubble. After 3 seconds, it will revert
// to normal close-on-deactivate behavior.
GetWidget()->SetCapture(NULL);
GetWidget()->set_auto_release_capture(false);
capture_timer_.Start(
FROM_HERE,
base::TimeDelta::FromSeconds(3),
this,
&GeneratedCreditCardBubbleViews::ReleaseCapture);
// This bubble doesn't render correctly on Windows without calling
// |SizeToContents()|. This must be called after showing the widget.
SizeToContents();
......@@ -115,8 +104,4 @@ GeneratedCreditCardBubbleViews::GeneratedCreditCardBubbleViews(
set_margins(gfx::Insets(0, insets.left(), insets.top(), insets.left()));
}
void GeneratedCreditCardBubbleViews::ReleaseCapture() {
GetWidget()->ReleaseCapture();
}
} // namespace autofill
......@@ -8,7 +8,6 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
#include "base/timer/timer.h"
#include "chrome/browser/ui/autofill/generated_credit_card_bubble_view.h"
#include "ui/views/bubble/bubble_delegate.h"
#include "ui/views/controls/styled_label_listener.h"
......@@ -48,15 +47,9 @@ class GeneratedCreditCardBubbleViews : public GeneratedCreditCardBubbleView,
explicit GeneratedCreditCardBubbleViews(
const base::WeakPtr<GeneratedCreditCardBubbleController>& controller);
// Releases focus capture (which is assumed on Show()).
void ReleaseCapture();
// Controller that drives this bubble. May be invalid when hiding.
base::WeakPtr<GeneratedCreditCardBubbleController> controller_;
// A timer used for releasing focus capture.
base::OneShotTimer<GeneratedCreditCardBubbleViews> capture_timer_;
base::WeakPtrFactory<GeneratedCreditCardBubbleViews> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(GeneratedCreditCardBubbleViews);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment