OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/tabs/tab.h" | 5 #include "chrome/browser/ui/views/tabs/tab.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <limits> | 8 #include <limits> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 p, radius, colors, nullptr, 2, SkShader::kClamp_TileMode))); | 204 p, radius, colors, nullptr, 2, SkShader::kClamp_TileMode))); |
205 canvas->sk_canvas()->drawRect( | 205 canvas->sk_canvas()->drawRect( |
206 SkRect::MakeXYWH(p.x() - radius, p.y() - radius, radius * 2, radius * 2), | 206 SkRect::MakeXYWH(p.x() - radius, p.y() - radius, radius * 2, radius * 2), |
207 flags); | 207 flags); |
208 } | 208 } |
209 | 209 |
210 // Returns whether the favicon for the given URL should be colored according to | 210 // Returns whether the favicon for the given URL should be colored according to |
211 // the browser theme. | 211 // the browser theme. |
212 bool ShouldThemifyFaviconForUrl(const GURL& url) { | 212 bool ShouldThemifyFaviconForUrl(const GURL& url) { |
213 return url.SchemeIs(content::kChromeUIScheme) && | 213 return url.SchemeIs(content::kChromeUIScheme) && |
214 url.host() != chrome::kChromeUIHelpHost && | 214 url.host() != content::kChromeUIHelpHost && |
215 url.host() != chrome::kChromeUIUberHost && | 215 url.host() != chrome::kChromeUIUberHost && |
216 url.host() != chrome::kChromeUIAppLauncherPageHost; | 216 url.host() != chrome::kChromeUIAppLauncherPageHost; |
217 } | 217 } |
218 | 218 |
219 // Returns a path corresponding to the tab's content region inside the outer | 219 // Returns a path corresponding to the tab's content region inside the outer |
220 // stroke. | 220 // stroke. |
221 gfx::Path GetFillPath(float scale, const gfx::Size& size) { | 221 gfx::Path GetFillPath(float scale, const gfx::Size& size) { |
222 const float right = size.width() * scale; | 222 const float right = size.width() * scale; |
223 // The bottom of the tab needs to be pixel-aligned or else when we call | 223 // The bottom of the tab needs to be pixel-aligned or else when we call |
224 // ClipPath with anti-aliasing enabled it can cause artifacts. | 224 // ClipPath with anti-aliasing enabled it can cause artifacts. |
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1486 gfx::Rect bounds = favicon_bounds_; | 1486 gfx::Rect bounds = favicon_bounds_; |
1487 if (bounds.IsEmpty()) | 1487 if (bounds.IsEmpty()) |
1488 return; | 1488 return; |
1489 | 1489 |
1490 // Extends the area to the bottom when the crash animation is in progress. | 1490 // Extends the area to the bottom when the crash animation is in progress. |
1491 if (crash_icon_animation_->is_animating()) | 1491 if (crash_icon_animation_->is_animating()) |
1492 bounds.set_height(height() - bounds.y()); | 1492 bounds.set_height(height() - bounds.y()); |
1493 bounds.set_x(GetMirroredXForRect(bounds)); | 1493 bounds.set_x(GetMirroredXForRect(bounds)); |
1494 SchedulePaintInRect(bounds); | 1494 SchedulePaintInRect(bounds); |
1495 } | 1495 } |
OLD | NEW |