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/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <cmath> | 9 #include <cmath> |
10 #include <utility> | 10 #include <utility> |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 void AppInfoView::OnPaint(gfx::Canvas* canvas) { | 177 void AppInfoView::OnPaint(gfx::Canvas* canvas) { |
178 gfx::Rect bounds = GetLocalBounds(); | 178 gfx::Rect bounds = GetLocalBounds(); |
179 | 179 |
180 SkRect border_rect = { | 180 SkRect border_rect = { |
181 SkIntToScalar(bounds.x()), | 181 SkIntToScalar(bounds.x()), |
182 SkIntToScalar(bounds.y()), | 182 SkIntToScalar(bounds.y()), |
183 SkIntToScalar(bounds.right()), | 183 SkIntToScalar(bounds.right()), |
184 SkIntToScalar(bounds.bottom()) | 184 SkIntToScalar(bounds.bottom()) |
185 }; | 185 }; |
186 | 186 |
187 SkPaint border_paint; | 187 cc::PaintFlags border_paint; |
188 border_paint.setAntiAlias(true); | 188 border_paint.setAntiAlias(true); |
189 border_paint.setARGB(0xFF, 0xC8, 0xC8, 0xC8); | 189 border_paint.setARGB(0xFF, 0xC8, 0xC8, 0xC8); |
190 | 190 |
191 canvas->sk_canvas()->drawRoundRect(border_rect, SkIntToScalar(2), | 191 canvas->sk_canvas()->drawRoundRect(border_rect, SkIntToScalar(2), |
192 SkIntToScalar(2), border_paint); | 192 SkIntToScalar(2), border_paint); |
193 | 193 |
194 SkRect inner_rect = { | 194 SkRect inner_rect = { |
195 border_rect.fLeft + SkDoubleToScalar(0.5), | 195 border_rect.fLeft + SkDoubleToScalar(0.5), |
196 border_rect.fTop + SkDoubleToScalar(0.5), | 196 border_rect.fTop + SkDoubleToScalar(0.5), |
197 border_rect.fRight - SkDoubleToScalar(0.5), | 197 border_rect.fRight - SkDoubleToScalar(0.5), |
198 border_rect.fBottom - SkDoubleToScalar(0.5), | 198 border_rect.fBottom - SkDoubleToScalar(0.5), |
199 }; | 199 }; |
200 | 200 |
201 SkPaint inner_paint; | 201 cc::PaintFlags inner_paint; |
202 inner_paint.setAntiAlias(true); | 202 inner_paint.setAntiAlias(true); |
203 inner_paint.setARGB(0xFF, 0xF8, 0xF8, 0xF8); | 203 inner_paint.setARGB(0xFF, 0xF8, 0xF8, 0xF8); |
204 canvas->sk_canvas()->drawRoundRect(inner_rect, SkDoubleToScalar(1.5), | 204 canvas->sk_canvas()->drawRoundRect(inner_rect, SkDoubleToScalar(1.5), |
205 SkDoubleToScalar(1.5), inner_paint); | 205 SkDoubleToScalar(1.5), inner_paint); |
206 } | 206 } |
207 | 207 |
208 } // namespace | 208 } // namespace |
209 | 209 |
210 namespace chrome { | 210 namespace chrome { |
211 | 211 |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
543 close_callback_.Run(false); | 543 close_callback_.Run(false); |
544 return CreateApplicationShortcutView::Cancel(); | 544 return CreateApplicationShortcutView::Cancel(); |
545 } | 545 } |
546 | 546 |
547 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( | 547 void CreateChromeApplicationShortcutView::OnAppInfoLoaded( |
548 std::unique_ptr<web_app::ShortcutInfo> shortcut_info, | 548 std::unique_ptr<web_app::ShortcutInfo> shortcut_info, |
549 const extensions::FileHandlersInfo& file_handlers_info) { | 549 const extensions::FileHandlersInfo& file_handlers_info) { |
550 shortcut_info_ = std::move(shortcut_info); | 550 shortcut_info_ = std::move(shortcut_info); |
551 file_handlers_info_ = file_handlers_info; | 551 file_handlers_info_ = file_handlers_info; |
552 } | 552 } |
OLD | NEW |