| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/location_bar/content_setting_image_view.h" | 5 #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/content_setting_bubble_model.h" | 9 #include "chrome/browser/content_setting_bubble_model.h" |
| 10 #include "chrome/browser/content_setting_image_model.h" | 10 #include "chrome/browser/content_setting_image_model.h" |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 } | 199 } |
| 200 // Paint yellow gradient background if in animation mode. | 200 // Paint yellow gradient background if in animation mode. |
| 201 const int kEdgeThickness = 1; | 201 const int kEdgeThickness = 1; |
| 202 SkPaint paint; | 202 SkPaint paint; |
| 203 paint.setShader(gfx::CreateGradientShader(kEdgeThickness, | 203 paint.setShader(gfx::CreateGradientShader(kEdgeThickness, |
| 204 height() - (2 * kEdgeThickness), | 204 height() - (2 * kEdgeThickness), |
| 205 kTopBoxColor, kBottomBoxColor)); | 205 kTopBoxColor, kBottomBoxColor)); |
| 206 SkSafeUnref(paint.getShader()); | 206 SkSafeUnref(paint.getShader()); |
| 207 SkRect color_rect; | 207 SkRect color_rect; |
| 208 color_rect.iset(0, 0, width() - 1, height() - 1); | 208 color_rect.iset(0, 0, width() - 1, height() - 1); |
| 209 canvas->AsCanvasSkia()->drawRoundRect(color_rect, kBoxCornerRadius, | 209 canvas->AsCanvasSkia()->skia_canvas()->drawRoundRect( |
| 210 kBoxCornerRadius, paint); | 210 color_rect, kBoxCornerRadius, kBoxCornerRadius, paint); |
| 211 SkPaint outer_paint; | 211 SkPaint outer_paint; |
| 212 outer_paint.setStyle(SkPaint::kStroke_Style); | 212 outer_paint.setStyle(SkPaint::kStroke_Style); |
| 213 outer_paint.setColor(kBorderColor); | 213 outer_paint.setColor(kBorderColor); |
| 214 color_rect.inset(SkIntToScalar(kEdgeThickness), | 214 color_rect.inset(SkIntToScalar(kEdgeThickness), |
| 215 SkIntToScalar(kEdgeThickness)); | 215 SkIntToScalar(kEdgeThickness)); |
| 216 canvas->AsCanvasSkia()->drawRoundRect(color_rect, kBoxCornerRadius, | 216 canvas->AsCanvasSkia()->skia_canvas()->drawRoundRect( |
| 217 kBoxCornerRadius, outer_paint); | 217 color_rect, kBoxCornerRadius, kBoxCornerRadius, outer_paint); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void ContentSettingImageView::BubbleClosing(Bubble* bubble, | 220 void ContentSettingImageView::BubbleClosing(Bubble* bubble, |
| 221 bool closed_by_escape) { | 221 bool closed_by_escape) { |
| 222 bubble_ = NULL; | 222 bubble_ = NULL; |
| 223 } | 223 } |
| 224 | 224 |
| 225 bool ContentSettingImageView::CloseOnEscape() { | 225 bool ContentSettingImageView::CloseOnEscape() { |
| 226 return true; | 226 return true; |
| 227 } | 227 } |
| (...skipping 13 matching lines...) Expand all Loading... |
| 241 } else if (state > (1.0 - kAnimatingFraction)) { | 241 } else if (state > (1.0 - kAnimatingFraction)) { |
| 242 visible_text_size_ = static_cast<int>(text_size_ * (1.0 - state) / | 242 visible_text_size_ = static_cast<int>(text_size_ * (1.0 - state) / |
| 243 kAnimatingFraction); | 243 kAnimatingFraction); |
| 244 } else { | 244 } else { |
| 245 visible_text_size_ = text_size_; | 245 visible_text_size_ = text_size_; |
| 246 } | 246 } |
| 247 parent_->Layout(); | 247 parent_->Layout(); |
| 248 parent_->SchedulePaint(); | 248 parent_->SchedulePaint(); |
| 249 } | 249 } |
| 250 | 250 |
| OLD | NEW |