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

Side by Side Diff: chrome/browser/ui/views/autofill/autofill_popup_base_view.cc

Issue 2824363002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/ui (Closed)
Patch Set: Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/autofill/autofill_popup_base_view.h" 5 #include "chrome/browser/ui/views/autofill/autofill_popup_base_view.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/threading/thread_task_runner_handle.h" 10 #include "base/threading/thread_task_runner_handle.h"
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // If we move off of the popup, we lose the selection. 130 // If we move off of the popup, we lose the selection.
131 ClearSelection(); 131 ClearSelection();
132 return false; 132 return false;
133 } 133 }
134 134
135 void AutofillPopupBaseView::OnMouseExited(const ui::MouseEvent& event) { 135 void AutofillPopupBaseView::OnMouseExited(const ui::MouseEvent& event) {
136 // Pressing return causes the cursor to hide, which will generate an 136 // Pressing return causes the cursor to hide, which will generate an
137 // OnMouseExited event. Pressing return should activate the current selection 137 // OnMouseExited event. Pressing return should activate the current selection
138 // via AcceleratorPressed, so we need to let that run first. 138 // via AcceleratorPressed, so we need to let that run first.
139 base::ThreadTaskRunnerHandle::Get()->PostTask( 139 base::ThreadTaskRunnerHandle::Get()->PostTask(
140 FROM_HERE, base::Bind(&AutofillPopupBaseView::ClearSelection, 140 FROM_HERE, base::BindOnce(&AutofillPopupBaseView::ClearSelection,
141 weak_ptr_factory_.GetWeakPtr())); 141 weak_ptr_factory_.GetWeakPtr()));
142 } 142 }
143 143
144 void AutofillPopupBaseView::OnMouseMoved(const ui::MouseEvent& event) { 144 void AutofillPopupBaseView::OnMouseMoved(const ui::MouseEvent& event) {
145 // A synthesized mouse move will be sent when the popup is first shown. 145 // A synthesized mouse move will be sent when the popup is first shown.
146 // Don't preview a suggestion if the mouse happens to be hovering there. 146 // Don't preview a suggestion if the mouse happens to be hovering there.
147 #if defined(OS_WIN) 147 #if defined(OS_WIN)
148 // TODO(rouslan): Use event.time_stamp() and ui::EventTimeForNow() when they 148 // TODO(rouslan): Use event.time_stamp() and ui::EventTimeForNow() when they
149 // become comparable. http://crbug.com/453559 149 // become comparable. http://crbug.com/453559
150 if (base::Time::Now() - show_time_ <= base::TimeDelta::FromMilliseconds(50)) 150 if (base::Time::Now() - show_time_ <= base::TimeDelta::FromMilliseconds(50))
151 return; 151 return;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 void AutofillPopupBaseView::HideController() { 234 void AutofillPopupBaseView::HideController() {
235 if (delegate_) 235 if (delegate_)
236 delegate_->Hide(); 236 delegate_->Hide();
237 } 237 }
238 238
239 gfx::NativeView AutofillPopupBaseView::container_view() { 239 gfx::NativeView AutofillPopupBaseView::container_view() {
240 return delegate_->container_view(); 240 return delegate_->container_view();
241 } 241 }
242 242
243 } // namespace autofill 243 } // namespace autofill
OLDNEW
« no previous file with comments | « chrome/browser/ui/unload_controller.cc ('k') | chrome/browser/ui/views/autofill/card_unmask_prompt_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698