| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/views/autofill/card_unmask_prompt_views.h" | 5 #include "chrome/browser/ui/views/autofill/card_unmask_prompt_views.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.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/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 const int kWidth = 375; | 243 const int kWidth = 375; |
| 244 return gfx::Size(kWidth, GetHeightForWidth(kWidth)); | 244 return gfx::Size(kWidth, GetHeightForWidth(kWidth)); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void CardUnmaskPromptViews::Layout() { | 247 void CardUnmaskPromptViews::Layout() { |
| 248 gfx::Rect contents_bounds = GetContentsBounds(); | 248 gfx::Rect contents_bounds = GetContentsBounds(); |
| 249 main_contents_->SetBoundsRect(contents_bounds); | 249 main_contents_->SetBoundsRect(contents_bounds); |
| 250 | 250 |
| 251 // The progress overlay extends from the top of the input row | 251 // The progress overlay extends from the top of the input row |
| 252 // to the bottom of the content area. | 252 // to the bottom of the content area. |
| 253 gfx::RectF input_rect = input_row_->GetContentsBounds(); | 253 gfx::RectF input_rect = gfx::RectF(input_row_->GetContentsBounds()); |
| 254 View::ConvertRectToTarget(input_row_, this, &input_rect); | 254 View::ConvertRectToTarget(input_row_, this, &input_rect); |
| 255 input_rect.set_height(contents_bounds.height()); | 255 input_rect.set_height(contents_bounds.height()); |
| 256 contents_bounds.Intersect(gfx::ToNearestRect(input_rect)); | 256 contents_bounds.Intersect(gfx::ToNearestRect(input_rect)); |
| 257 progress_overlay_->SetBoundsRect(contents_bounds); | 257 progress_overlay_->SetBoundsRect(contents_bounds); |
| 258 } | 258 } |
| 259 | 259 |
| 260 int CardUnmaskPromptViews::GetHeightForWidth(int width) const { | 260 int CardUnmaskPromptViews::GetHeightForWidth(int width) const { |
| 261 if (!has_children()) | 261 if (!has_children()) |
| 262 return 0; | 262 return 0; |
| 263 const gfx::Insets insets = GetInsets(); | 263 const gfx::Insets insets = GetInsets(); |
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 521 views::View::OnPaint(canvas); | 521 views::View::OnPaint(canvas); |
| 522 canvas->Restore(); | 522 canvas->Restore(); |
| 523 } | 523 } |
| 524 | 524 |
| 525 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { | 525 void CardUnmaskPromptViews::FadeOutView::SetAlpha(uint8_t alpha) { |
| 526 alpha_ = alpha; | 526 alpha_ = alpha; |
| 527 SchedulePaint(); | 527 SchedulePaint(); |
| 528 } | 528 } |
| 529 | 529 |
| 530 } // namespace autofill | 530 } // namespace autofill |
| OLD | NEW |