OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/fullscreen_exit_bubble.h" | 5 #include "chrome/browser/views/fullscreen_exit_bubble.h" |
6 | 6 |
7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/l10n_util_win.h" | 9 #include "app/l10n_util_win.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 void FullscreenExitBubble::FullscreenExitView::Layout() { | 68 void FullscreenExitBubble::FullscreenExitView::Layout() { |
69 gfx::Size link_preferred_size(link_.GetPreferredSize()); | 69 gfx::Size link_preferred_size(link_.GetPreferredSize()); |
70 link_.SetBounds(kPaddingPixels, | 70 link_.SetBounds(kPaddingPixels, |
71 height() - kPaddingPixels - link_preferred_size.height(), | 71 height() - kPaddingPixels - link_preferred_size.height(), |
72 link_preferred_size.width(), link_preferred_size.height()); | 72 link_preferred_size.width(), link_preferred_size.height()); |
73 } | 73 } |
74 | 74 |
75 void FullscreenExitBubble::FullscreenExitView::Paint(gfx::Canvas* canvas) { | 75 void FullscreenExitBubble::FullscreenExitView::Paint(gfx::Canvas* canvas) { |
76 // Create a round-bottomed rect to fill the whole View. | 76 // Create a round-bottomed rect to fill the whole View. |
77 CRect parent_rect; | |
78 SkRect rect; | 77 SkRect rect; |
79 SkScalar padding = SkIntToScalar(kPaddingPixels); | 78 SkScalar padding = SkIntToScalar(kPaddingPixels); |
80 // The "-padding" top coordinate ensures that the rect is always tall enough | 79 // The "-padding" top coordinate ensures that the rect is always tall enough |
81 // to contain the complete rounded corner radius. If we set this to 0, as the | 80 // to contain the complete rounded corner radius. If we set this to 0, as the |
82 // popup slides offscreen (in reality, squishes to 0 height), the corners will | 81 // popup slides offscreen (in reality, squishes to 0 height), the corners will |
83 // flatten out as the height becomes less than the corner radius. | 82 // flatten out as the height becomes less than the corner radius. |
84 rect.set(0, -padding, SkIntToScalar(width()), SkIntToScalar(height())); | 83 rect.set(0, -padding, SkIntToScalar(width()), SkIntToScalar(height())); |
85 SkScalar rad[8] = { 0, 0, 0, 0, padding, padding, padding, padding }; | 84 SkScalar rad[8] = { 0, 0, 0, 0, padding, padding, padding, padding }; |
86 SkPath path; | 85 SkPath path; |
87 path.addRoundRect(rect, rad, SkPath::kCW_Direction); | 86 path.addRoundRect(rect, rad, SkPath::kCW_Direction); |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 bool ignore_animation_state) const { | 258 bool ignore_animation_state) const { |
260 gfx::Size size(view_->GetPreferredSize()); | 259 gfx::Size size(view_->GetPreferredSize()); |
261 if (!ignore_animation_state) { | 260 if (!ignore_animation_state) { |
262 size.set_height(static_cast<int>(static_cast<double>(size.height()) * | 261 size.set_height(static_cast<int>(static_cast<double>(size.height()) * |
263 size_animation_->GetCurrentValue())); | 262 size_animation_->GetCurrentValue())); |
264 } | 263 } |
265 gfx::Point origin((root_view_->width() - size.width()) / 2, 0); | 264 gfx::Point origin((root_view_->width() - size.width()) / 2, 0); |
266 views::View::ConvertPointToScreen(root_view_, &origin); | 265 views::View::ConvertPointToScreen(root_view_, &origin); |
267 return gfx::Rect(origin, size); | 266 return gfx::Rect(origin, size); |
268 } | 267 } |
OLD | NEW |