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

Side by Side Diff: chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.mm

Issue 1540423004: Add card details and legal message to Android save credit card infobar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Edits Created 4 years, 11 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/cocoa/infobars/confirm_infobar_controller.h" 5 #include "chrome/browser/ui/cocoa/infobars/confirm_infobar_controller.h"
6 6
7 #include <utility>
8
7 #include "base/logging.h" 9 #include "base/logging.h"
8 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
9 #include "chrome/browser/infobars/infobar_service.h" 11 #include "chrome/browser/infobars/infobar_service.h"
10 #include "chrome/browser/ui/chrome_style.h" 12 #include "chrome/browser/ui/chrome_style.h"
11 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h" 13 #include "chrome/browser/ui/cocoa/infobars/infobar_cocoa.h"
14 #include "components/autofill/core/browser/autofill_cc_infobar_delegate.h"
12 #include "components/infobars/core/confirm_infobar_delegate.h" 15 #include "components/infobars/core/confirm_infobar_delegate.h"
13 #include "skia/ext/skia_utils_mac.h" 16 #include "skia/ext/skia_utils_mac.h"
14 #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutT weaker.h" 17 #include "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutT weaker.h"
15 #import "ui/base/cocoa/cocoa_base_utils.h" 18 #import "ui/base/cocoa/cocoa_base_utils.h"
16 #import "ui/base/cocoa/controls/hyperlink_text_view.h" 19 #import "ui/base/cocoa/controls/hyperlink_text_view.h"
17 #include "ui/base/window_open_disposition.h" 20 #include "ui/base/window_open_disposition.h"
18 21
19 @implementation ConfirmInfoBarController 22 @implementation ConfirmInfoBarController
20 23
21 // Called when someone clicks on the "OK" button. 24 // Called when someone clicks on the "OK" button.
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 WindowOpenDisposition disposition = 143 WindowOpenDisposition disposition =
141 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]); 144 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]);
142 if ([self delegate]->AsConfirmInfoBarDelegate()->LinkClicked(disposition)) 145 if ([self delegate]->AsConfirmInfoBarDelegate()->LinkClicked(disposition))
143 [self removeSelf]; 146 [self removeSelf];
144 } 147 }
145 148
146 @end 149 @end
147 150
148 scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar( 151 scoped_ptr<infobars::InfoBar> InfoBarService::CreateConfirmInfoBar(
149 scoped_ptr<ConfirmInfoBarDelegate> delegate) { 152 scoped_ptr<ConfirmInfoBarDelegate> delegate) {
150 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(delegate.Pass())); 153 scoped_ptr<InfoBarCocoa> infobar(new InfoBarCocoa(std::move(delegate)));
151 base::scoped_nsobject<ConfirmInfoBarController> controller( 154 base::scoped_nsobject<ConfirmInfoBarController> controller(
152 [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]); 155 [[ConfirmInfoBarController alloc] initWithInfoBar:infobar.get()]);
153 infobar->set_controller(controller); 156 infobar->set_controller(controller);
154 return infobar.Pass(); 157 return std::move(infobar);
155 } 158 }
159
160 scoped_ptr<infobars::InfoBar> InfoBarService::CreateAutofillCCInfoBar(
161 scoped_ptr<autofill::AutofillCCInfoBarDelegate> delegate) {
162 return CreateConfirmInfoBar(std::move(delegate));
Justin Donnelly 2016/01/07 18:15:40 Add a TODO(jdonnelly) to add an iOS CC implementat
please use gerrit instead 2016/01/08 00:07:05 Done.
163 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698