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

Side by Side Diff: chrome/browser/infobars/infobar_responder.cc

Issue 2828663002: Rewrite base::Bind to base::BindOnce with base_bind_rewriters in //chrome/browser/{i,l,m,n,p,r}* (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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/infobars/infobar_responder.h" 5 #include "chrome/browser/infobars/infobar_responder.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 13 matching lines...) Expand all
24 infobar_service_->RemoveObserver(this); 24 infobar_service_->RemoveObserver(this);
25 } 25 }
26 26
27 void InfoBarResponder::OnInfoBarAdded(infobars::InfoBar* infobar) { 27 void InfoBarResponder::OnInfoBarAdded(infobars::InfoBar* infobar) {
28 infobar_service_->RemoveObserver(this); 28 infobar_service_->RemoveObserver(this);
29 ConfirmInfoBarDelegate* delegate = 29 ConfirmInfoBarDelegate* delegate =
30 infobar->delegate()->AsConfirmInfoBarDelegate(); 30 infobar->delegate()->AsConfirmInfoBarDelegate();
31 DCHECK(delegate); 31 DCHECK(delegate);
32 32
33 base::ThreadTaskRunnerHandle::Get()->PostTask( 33 base::ThreadTaskRunnerHandle::Get()->PostTask(
34 FROM_HERE, 34 FROM_HERE, base::BindOnce(&InfoBarResponder::Respond,
35 base::Bind(&InfoBarResponder::Respond, base::Unretained(this), delegate)); 35 base::Unretained(this), delegate));
36 } 36 }
37 37
38 void InfoBarResponder::OnInfoBarReplaced(infobars::InfoBar* old_infobar, 38 void InfoBarResponder::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
39 infobars::InfoBar* new_infobar) { 39 infobars::InfoBar* new_infobar) {
40 OnInfoBarAdded(new_infobar); 40 OnInfoBarAdded(new_infobar);
41 } 41 }
42 42
43 void InfoBarResponder::Respond(ConfirmInfoBarDelegate* delegate) { 43 void InfoBarResponder::Respond(ConfirmInfoBarDelegate* delegate) {
44 switch (response_) { 44 switch (response_) {
45 case ACCEPT: 45 case ACCEPT:
46 delegate->Accept(); 46 delegate->Accept();
47 break; 47 break;
48 case DENY: 48 case DENY:
49 delegate->Cancel(); 49 delegate->Cancel();
50 break; 50 break;
51 case DISMISS: 51 case DISMISS:
52 delegate->InfoBarDismissed(); 52 delegate->InfoBarDismissed();
53 break; 53 break;
54 } 54 }
55 } 55 }
OLDNEW
« no previous file with comments | « chrome/browser/importer/external_process_importer_client.cc ('k') | chrome/browser/interstitials/chrome_controller_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698