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

Side by Side Diff: chrome/browser/ui/autofill/autofill_dialog_controller_impl.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rename methods and vars to make image_scale more clear Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 text))); 461 text)));
462 } 462 }
463 463
464 gfx::Image GetGeneratedCardImage(const base::string16& card_number, 464 gfx::Image GetGeneratedCardImage(const base::string16& card_number,
465 const base::string16& name, 465 const base::string16& name,
466 const SkColor& gradient_top, 466 const SkColor& gradient_top,
467 const SkColor& gradient_bottom) { 467 const SkColor& gradient_bottom) {
468 const int kCardWidthPx = 300; 468 const int kCardWidthPx = 300;
469 const int kCardHeightPx = 190; 469 const int kCardHeightPx = 190;
470 const gfx::Size size(kCardWidthPx, kCardHeightPx); 470 const gfx::Size size(kCardWidthPx, kCardHeightPx);
471 gfx::Canvas canvas(size, ui::SCALE_FACTOR_100P, false); 471 gfx::Canvas canvas(size, 1.0f, false);
472 472
473 gfx::Rect display_rect(size); 473 gfx::Rect display_rect(size);
474 474
475 skia::RefPtr<SkShader> shader = gfx::CreateGradientShader( 475 skia::RefPtr<SkShader> shader = gfx::CreateGradientShader(
476 0, size.height(), gradient_top, gradient_bottom); 476 0, size.height(), gradient_top, gradient_bottom);
477 SkPaint paint; 477 SkPaint paint;
478 paint.setShader(shader.get()); 478 paint.setShader(shader.get());
479 canvas.DrawRoundRect(display_rect, 8, paint); 479 canvas.DrawRoundRect(display_rect, 8, paint);
480 480
481 display_rect.Inset(20, 0, 0, 0); 481 display_rect.Inset(20, 0, 0, 0);
(...skipping 2878 matching lines...) Expand 10 before | Expand all | Expand 10 after
3360 } 3360 }
3361 3361
3362 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() { 3362 void AutofillDialogControllerImpl::OnSubmitButtonDelayEnd() {
3363 if (!view_) 3363 if (!view_)
3364 return; 3364 return;
3365 ScopedViewUpdates updates(view_.get()); 3365 ScopedViewUpdates updates(view_.get());
3366 view_->UpdateButtonStrip(); 3366 view_->UpdateButtonStrip();
3367 } 3367 }
3368 3368
3369 } // namespace autofill 3369 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698