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

Unified Diff: chrome/browser/chromeos/status/network_menu_button.cc

Issue 8351021: Use Closure instead of ScopedRunnableMethodFactory in NetworkMenuButton. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: weak_ptr_factory_ Created 9 years, 2 months 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/chromeos/status/network_menu_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/status/network_menu_button.cc
===================================================================
--- chrome/browser/chromeos/status/network_menu_button.cc (revision 106989)
+++ chrome/browser/chromeos/status/network_menu_button.cc (working copy)
@@ -6,7 +6,9 @@
#include <algorithm>
#include <limits>
+#include <vector>
+#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop.h"
#include "base/string_util.h"
@@ -100,7 +102,7 @@
is_browser_mode_(false),
check_for_promo_(true),
was_sim_locked_(false),
- ALLOW_THIS_IN_INITIALIZER_LIST(method_factory_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_ptr_factory_(this)) {
is_browser_mode_ = (host->GetScreenMode() == StatusAreaHost::kBrowserMode);
network_menu_.reset(new NetworkMenu(this, is_browser_mode_));
network_icon_.reset(
@@ -385,10 +387,11 @@
if (!screen_bounds.Contains(button_bounds)) {
// If we're not on screen yet, delay notification display.
// It may be shown earlier, on next NetworkLibrary callback processing.
- if (method_factory_.empty()) {
+ if (!weak_ptr_factory_.HasWeakPtrs()) {
MessageLoop::current()->PostDelayedTask(FROM_HERE,
- method_factory_.NewRunnableMethod(
+ base::Bind(
&NetworkMenuButton::ShowOptionalMobileDataPromoNotification,
+ weak_ptr_factory_.GetWeakPtr(),
cros),
kPromoShowDelayMs);
}
« no previous file with comments | « chrome/browser/chromeos/status/network_menu_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698