Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(618)

Unified Diff: chrome/browser/omnibox_search_hint.cc

Issue 8960010: base::Bind: Convert NewRunnableMethod in chrome/browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Build fix 55. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/net/sqlite_origin_bound_cert_store.cc ('k') | chrome/browser/oom_priority_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/omnibox_search_hint.cc
diff --git a/chrome/browser/omnibox_search_hint.cc b/chrome/browser/omnibox_search_hint.cc
index abdcbae89af73bb58f959c85635fa109b7d5b854..dd3e5c76e984ae20c2c0a414a8a8d637776a0e34 100644
--- a/chrome/browser/omnibox_search_hint.cc
+++ b/chrome/browser/omnibox_search_hint.cc
@@ -4,7 +4,9 @@
#include "chrome/browser/omnibox_search_hint.h"
+#include "base/bind.h"
#include "base/command_line.h"
+#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/task.h"
@@ -79,7 +81,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_;
DISALLOW_COPY_AND_ASSIGN(HintInfoBar);
};
@@ -89,11 +91,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,
- method_factory_.NewRunnableMethod(&HintInfoBar::AllowExpiry),
+ MessageLoop::current()->PostDelayedTask(
+ FROM_HERE,
+ base::Bind(&HintInfoBar::AllowExpiry, weak_factory_.GetWeakPtr()),
8000); // 8 seconds.
}
« no previous file with comments | « chrome/browser/net/sqlite_origin_bound_cert_store.cc ('k') | chrome/browser/oom_priority_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698