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

Unified Diff: chrome/browser/ui/input_window_dialog_win.cc

Issue 8590012: base::Bind migrations in chrome/browser (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 | « no previous file | chrome/browser/ui/login/login_prompt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/input_window_dialog_win.cc
===================================================================
--- chrome/browser/ui/input_window_dialog_win.cc (revision 110185)
+++ chrome/browser/ui/input_window_dialog_win.cc (working copy)
@@ -4,9 +4,10 @@
#include "chrome/browser/ui/input_window_dialog.h"
+#include "base/bind.h"
#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
#include "base/message_loop.h"
-#include "base/task.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/ui/webui/chrome_web_ui.h"
#include "chrome/browser/ui/webui/input_window_dialog_webui.h"
@@ -109,7 +110,7 @@
InputWindowDialogWin* delegate_;
// Helps us set focus to the first Textfield in the window.
- ScopedRunnableMethodFactory<ContentView> focus_grabber_factory_;
+ base::WeakPtrFactory<ContentView> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(ContentView);
};
@@ -118,7 +119,7 @@
// ContentView
ContentView::ContentView(InputWindowDialogWin* delegate)
: delegate_(delegate),
- ALLOW_THIS_IN_INITIALIZER_LIST(focus_grabber_factory_(this)) {
+ ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
DCHECK(delegate_);
}
@@ -220,9 +221,9 @@
layout->AddView(label);
layout->AddView(text_field_);
- MessageLoop::current()->PostTask(FROM_HERE,
- focus_grabber_factory_.NewRunnableMethod(
- &ContentView::FocusFirstFocusableControl));
+ MessageLoop::current()->PostTask(
+ FROM_HERE, base::Bind(&ContentView::FocusFirstFocusableControl,
+ weak_factory_.GetWeakPtr()));
}
void ContentView::FocusFirstFocusableControl() {
« no previous file with comments | « no previous file | chrome/browser/ui/login/login_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698