Index: chrome/browser/omnibox_search_hint.cc |
diff --git a/chrome/browser/omnibox_search_hint.cc b/chrome/browser/omnibox_search_hint.cc |
index 22ff1b54a28eb65bdcdc147e68cb63b2f21d3806..693015ebd57cb314943c8603e0560545be425389 100644 |
--- a/chrome/browser/omnibox_search_hint.cc |
+++ b/chrome/browser/omnibox_search_hint.cc |
@@ -4,6 +4,7 @@ |
#include "chrome/browser/omnibox_search_hint.h" |
+#include "base/bind.h" |
#include "base/command_line.h" |
#include "base/metrics/histogram.h" |
#include "base/task.h" |
@@ -79,7 +80,7 @@ class HintInfoBar : public ConfirmInfoBarDelegate { |
bool should_expire_; |
// Used to delay the expiration of the info-bar. |
- ScopedRunnableMethodFactory<HintInfoBar> method_factory_; |
+ base::WeakPtrFactory<HintInfoBar> weak_factory_; |
James Hawkins
2011/11/22 00:43:37
#include "base/memory/weak_ptr.h"
groby-ooo-7-16
2011/11/22 03:44:44
Done.
|
DISALLOW_COPY_AND_ASSIGN(HintInfoBar); |
}; |
@@ -89,12 +90,12 @@ HintInfoBar::HintInfoBar(OmniboxSearchHint* omnibox_hint) |
omnibox_hint_(omnibox_hint), |
action_taken_(false), |
should_expire_(false), |
- ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) { |
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) { |
// We want the info-bar to stick-around for few seconds and then be hidden |
// on the next navigation after that. |
MessageLoop::current()->PostDelayedTask(FROM_HERE, |
James Hawkins
2011/11/22 00:43:37
Start of parameters must all be on the same column
groby-ooo-7-16
2011/11/22 03:44:44
Done.
|
- method_factory_.NewRunnableMethod(&HintInfoBar::AllowExpiry), |
- 8000); // 8 seconds. |
+ base::Bind(&HintInfoBar::AllowExpiry, weak_factory_.GetWeakPtr()), |
+ 8000); // 8 seconds. |
} |
HintInfoBar::~HintInfoBar() { |