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

Side by Side Diff: chrome/browser/payments/chrome_payment_request_delegate.cc

Issue 2768093006: [Payments] Desktop: Error message in the dialog. (Closed)
Patch Set: Test 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
« no previous file with comments | « chrome/browser/payments/chrome_payment_request_delegate.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/payments/chrome_payment_request_delegate.h" 5 #include "chrome/browser/payments/chrome_payment_request_delegate.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "chrome/browser/autofill/personal_data_manager_factory.h" 8 #include "chrome/browser/autofill/personal_data_manager_factory.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 13 matching lines...) Expand all
24 dialog_->ShowDialog(); 24 dialog_->ShowDialog();
25 } 25 }
26 26
27 void ChromePaymentRequestDelegate::CloseDialog() { 27 void ChromePaymentRequestDelegate::CloseDialog() {
28 if (dialog_) { 28 if (dialog_) {
29 dialog_->CloseDialog(); 29 dialog_->CloseDialog();
30 dialog_ = nullptr; 30 dialog_ = nullptr;
31 } 31 }
32 } 32 }
33 33
34 void ChromePaymentRequestDelegate::ShowErrorMessage() {
35 if (dialog_)
36 dialog_->ShowErrorMessage();
37 }
38
34 autofill::PersonalDataManager* 39 autofill::PersonalDataManager*
35 ChromePaymentRequestDelegate::GetPersonalDataManager() { 40 ChromePaymentRequestDelegate::GetPersonalDataManager() {
36 return autofill::PersonalDataManagerFactory::GetForProfile( 41 return autofill::PersonalDataManagerFactory::GetForProfile(
37 Profile::FromBrowserContext(web_contents_->GetBrowserContext())); 42 Profile::FromBrowserContext(web_contents_->GetBrowserContext()));
38 } 43 }
39 44
40 const std::string& ChromePaymentRequestDelegate::GetApplicationLocale() const { 45 const std::string& ChromePaymentRequestDelegate::GetApplicationLocale() const {
41 return g_browser_process->GetApplicationLocale(); 46 return g_browser_process->GetApplicationLocale();
42 } 47 }
43 48
44 bool ChromePaymentRequestDelegate::IsIncognito() const { 49 bool ChromePaymentRequestDelegate::IsIncognito() const {
45 Profile* profile = 50 Profile* profile =
46 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); 51 Profile::FromBrowserContext(web_contents_->GetBrowserContext());
47 return profile && profile->GetProfileType() == Profile::INCOGNITO_PROFILE; 52 return profile && profile->GetProfileType() == Profile::INCOGNITO_PROFILE;
48 } 53 }
49 54
50 } // namespace payments 55 } // namespace payments
OLDNEW
« no previous file with comments | « chrome/browser/payments/chrome_payment_request_delegate.h ('k') | chrome/browser/ui/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698