| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/autofill/autofill_dialog_controller_impl.h" | 5 #include "chrome/browser/ui/autofill/autofill_dialog_controller_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1425 } | 1425 } |
| 1426 | 1426 |
| 1427 gfx::Image AutofillDialogControllerImpl::GetGeneratedCardImage( | 1427 gfx::Image AutofillDialogControllerImpl::GetGeneratedCardImage( |
| 1428 const base::string16& card_number, | 1428 const base::string16& card_number, |
| 1429 const base::string16& name, | 1429 const base::string16& name, |
| 1430 const SkColor& gradient_top, | 1430 const SkColor& gradient_top, |
| 1431 const SkColor& gradient_bottom) { | 1431 const SkColor& gradient_bottom) { |
| 1432 const int kCardWidthPx = 300; | 1432 const int kCardWidthPx = 300; |
| 1433 const int kCardHeightPx = 190; | 1433 const int kCardHeightPx = 190; |
| 1434 const gfx::Size size(kCardWidthPx, kCardHeightPx); | 1434 const gfx::Size size(kCardWidthPx, kCardHeightPx); |
| 1435 ui::ScaleFactor scale_factor = ui::GetScaleFactorForNativeView( | 1435 float scale_factor = ui::GetScaleFactorForNativeView( |
| 1436 web_contents()->GetNativeView()); | 1436 web_contents()->GetNativeView()); |
| 1437 gfx::Canvas canvas(size, ui::GetImageScale(scale_factor), false); | 1437 gfx::Canvas canvas(size, scale_factor, false); |
| 1438 | 1438 |
| 1439 gfx::Rect display_rect(size); | 1439 gfx::Rect display_rect(size); |
| 1440 | 1440 |
| 1441 skia::RefPtr<SkShader> shader = gfx::CreateGradientShader( | 1441 skia::RefPtr<SkShader> shader = gfx::CreateGradientShader( |
| 1442 0, size.height(), gradient_top, gradient_bottom); | 1442 0, size.height(), gradient_top, gradient_bottom); |
| 1443 SkPaint paint; | 1443 SkPaint paint; |
| 1444 paint.setShader(shader.get()); | 1444 paint.setShader(shader.get()); |
| 1445 canvas.DrawRoundRect(display_rect, 8, paint); | 1445 canvas.DrawRoundRect(display_rect, 8, paint); |
| 1446 | 1446 |
| 1447 display_rect.Inset(20, 0, 0, 0); | 1447 display_rect.Inset(20, 0, 0, 0); |
| (...skipping 2648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4096 view_->UpdateButtonStrip(); | 4096 view_->UpdateButtonStrip(); |
| 4097 } | 4097 } |
| 4098 | 4098 |
| 4099 void AutofillDialogControllerImpl::FetchWalletCookie() { | 4099 void AutofillDialogControllerImpl::FetchWalletCookie() { |
| 4100 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); | 4100 net::URLRequestContextGetter* request_context = profile_->GetRequestContext(); |
| 4101 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); | 4101 signin_helper_.reset(new wallet::WalletSigninHelper(this, request_context)); |
| 4102 signin_helper_->StartWalletCookieValueFetch(); | 4102 signin_helper_->StartWalletCookieValueFetch(); |
| 4103 } | 4103 } |
| 4104 | 4104 |
| 4105 } // namespace autofill | 4105 } // namespace autofill |
| OLD | NEW |