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

Side by Side Diff: chrome/browser/extensions/bookmark_app_helper.cc

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/bookmark_app_helper.h" 5 #include "chrome/browser/extensions/bookmark_app_helper.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <cctype> 9 #include <cctype>
10 #include <string> 10 #include <string>
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 const size_t font_size = output_size_ * 7 / 16; 100 const size_t font_size = output_size_ * 7 / 16;
101 101
102 std::string font_name = 102 std::string font_name =
103 l10n_util::GetStringUTF8(IDS_SANS_SERIF_FONT_FAMILY); 103 l10n_util::GetStringUTF8(IDS_SANS_SERIF_FONT_FAMILY);
104 #if defined(OS_CHROMEOS) 104 #if defined(OS_CHROMEOS)
105 const std::string kChromeOSFontFamily = "Noto Sans"; 105 const std::string kChromeOSFontFamily = "Noto Sans";
106 font_name = kChromeOSFontFamily; 106 font_name = kChromeOSFontFamily;
107 #endif 107 #endif
108 108
109 // Draw a rounded rect of the given |color|. 109 // Draw a rounded rect of the given |color|.
110 SkPaint background_paint; 110 CdlPaint background_paint;
111 background_paint.setFlags(SkPaint::kAntiAlias_Flag); 111 background_paint.setAntiAlias(true);
112 background_paint.setColor(color_); 112 background_paint.setColor(color_);
113 113
114 gfx::Rect icon_rect(icon_inset, icon_inset, icon_size, icon_size); 114 gfx::Rect icon_rect(icon_inset, icon_inset, icon_size, icon_size);
115 canvas->DrawRoundRect(icon_rect, border_radius, background_paint); 115 canvas->DrawRoundRect(icon_rect, border_radius, background_paint);
116 116
117 // The text rect's size needs to be odd to center the text correctly. 117 // The text rect's size needs to be odd to center the text correctly.
118 gfx::Rect text_rect(icon_inset, icon_inset, icon_size + 1, icon_size + 1); 118 gfx::Rect text_rect(icon_inset, icon_inset, icon_size + 1, icon_size + 1);
119 // Draw the letter onto the rounded rect. The letter's color depends on the 119 // Draw the letter onto the rounded rect. The letter's color depends on the
120 // luma of |color|. 120 // luma of |color|.
121 const uint8_t luma = color_utils::GetLuma(color_); 121 const uint8_t luma = color_utils::GetLuma(color_);
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); 799 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback));
800 } 800 }
801 801
802 bool IsValidBookmarkAppUrl(const GURL& url) { 802 bool IsValidBookmarkAppUrl(const GURL& url) {
803 URLPattern origin_only_pattern(Extension::kValidBookmarkAppSchemes); 803 URLPattern origin_only_pattern(Extension::kValidBookmarkAppSchemes);
804 origin_only_pattern.SetMatchAllURLs(true); 804 origin_only_pattern.SetMatchAllURLs(true);
805 return url.is_valid() && origin_only_pattern.MatchesURL(url); 805 return url.is_valid() && origin_only_pattern.MatchesURL(url);
806 } 806 }
807 807
808 } // namespace extensions 808 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/download/download_shelf.cc ('k') | chrome/browser/profiles/profile_avatar_icon_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698