Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: chrome/browser/views/create_application_shortcut_view.cc

Issue 2811032: Revert 50784 - Canvas refactoring part 3.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/bubble_border.cc ('k') | chrome/browser/views/detachable_toolbar_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/create_application_shortcut_view.h" 5 #include "chrome/browser/views/create_application_shortcut_view.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "chrome/browser/pref_service.h" 10 #include "chrome/browser/pref_service.h"
11 #include "chrome/browser/profile.h" 11 #include "chrome/browser/profile.h"
12 #include "chrome/browser/tab_contents/tab_contents.h" 12 #include "chrome/browser/tab_contents/tab_contents.h"
13 #include "chrome/browser/tab_contents/tab_contents_delegate.h" 13 #include "chrome/browser/tab_contents/tab_contents_delegate.h"
14 #include "chrome/common/chrome_constants.h" 14 #include "chrome/common/chrome_constants.h"
15 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
16 #include "gfx/canvas_skia.h" 16 #include "gfx/canvas.h"
17 #include "gfx/codec/png_codec.h" 17 #include "gfx/codec/png_codec.h"
18 #include "grit/generated_resources.h" 18 #include "grit/generated_resources.h"
19 #include "grit/locale_settings.h" 19 #include "grit/locale_settings.h"
20 #include "net/base/load_flags.h" 20 #include "net/base/load_flags.h"
21 #include "net/url_request/url_request.h" 21 #include "net/url_request/url_request.h"
22 #include "third_party/skia/include/core/SkRect.h" 22 #include "third_party/skia/include/core/SkRect.h"
23 #include "third_party/skia/include/core/SkPaint.h" 23 #include "third_party/skia/include/core/SkPaint.h"
24 #include "views/controls/button/checkbox.h" 24 #include "views/controls/button/checkbox.h"
25 #include "views/controls/image_view.h" 25 #include "views/controls/image_view.h"
26 #include "views/controls/label.h" 26 #include "views/controls/label.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 SkIntToScalar(bounds.x()), 162 SkIntToScalar(bounds.x()),
163 SkIntToScalar(bounds.y()), 163 SkIntToScalar(bounds.y()),
164 SkIntToScalar(bounds.right()), 164 SkIntToScalar(bounds.right()),
165 SkIntToScalar(bounds.bottom()) 165 SkIntToScalar(bounds.bottom())
166 }; 166 };
167 167
168 SkPaint border_paint; 168 SkPaint border_paint;
169 border_paint.setAntiAlias(true); 169 border_paint.setAntiAlias(true);
170 border_paint.setARGB(0xFF, 0xC8, 0xC8, 0xC8); 170 border_paint.setARGB(0xFF, 0xC8, 0xC8, 0xC8);
171 171
172 canvas->AsCanvasSkia()->drawRoundRect( 172 canvas->drawRoundRect(border_rect, SkIntToScalar(2), SkIntToScalar(2),
173 border_rect, SkIntToScalar(2), SkIntToScalar(2), border_paint); 173 border_paint);
174 174
175 SkRect inner_rect = { 175 SkRect inner_rect = {
176 border_rect.fLeft + SkDoubleToScalar(0.5), 176 border_rect.fLeft + SkDoubleToScalar(0.5),
177 border_rect.fTop + SkDoubleToScalar(0.5), 177 border_rect.fTop + SkDoubleToScalar(0.5),
178 border_rect.fRight - SkDoubleToScalar(0.5), 178 border_rect.fRight - SkDoubleToScalar(0.5),
179 border_rect.fBottom - SkDoubleToScalar(0.5), 179 border_rect.fBottom - SkDoubleToScalar(0.5),
180 }; 180 };
181 181
182 SkPaint inner_paint; 182 SkPaint inner_paint;
183 inner_paint.setAntiAlias(true); 183 inner_paint.setAntiAlias(true);
184 inner_paint.setARGB(0xFF, 0xF8, 0xF8, 0xF8); 184 inner_paint.setARGB(0xFF, 0xF8, 0xF8, 0xF8);
185 canvas->AsCanvasSkia()->drawRoundRect( 185 canvas->drawRoundRect(inner_rect, SkIntToScalar(1.5), SkIntToScalar(1.5),
186 inner_rect, SkIntToScalar(1.5), SkIntToScalar(1.5), inner_paint); 186 inner_paint);
187 } 187 }
188 188
189 }; // namespace 189 }; // namespace
190 190
191 namespace browser { 191 namespace browser {
192 192
193 void ShowCreateShortcutsDialog(gfx::NativeWindow parent_window, 193 void ShowCreateShortcutsDialog(gfx::NativeWindow parent_window,
194 TabContents* tab_contents) { 194 TabContents* tab_contents) {
195 views::Window::CreateChromeWindow(parent_window, gfx::Rect(), 195 views::Window::CreateChromeWindow(parent_window, gfx::Rect(),
196 new CreateApplicationShortcutView(tab_contents))->Show(); 196 new CreateApplicationShortcutView(tab_contents))->Show();
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 const SkBitmap& image) { 447 const SkBitmap& image) {
448 pending_download_ = NULL; 448 pending_download_ = NULL;
449 449
450 if (!errored && !image.isNull()) { 450 if (!errored && !image.isNull()) {
451 shortcut_info_.favicon = image; 451 shortcut_info_.favicon = image;
452 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); 452 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon);
453 } else { 453 } else {
454 FetchIcon(); 454 FetchIcon();
455 } 455 }
456 } 456 }
OLDNEW
« no previous file with comments | « chrome/browser/views/bubble_border.cc ('k') | chrome/browser/views/detachable_toolbar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698