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

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

Issue 836053002: Added 128px icon size for bookmarked apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated ExtensionManagementApiTest for new icons Created 5 years, 11 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
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/management/test/generateAppForLink.js » ('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 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 <cctype> 7 #include <cctype>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/extensions/crx_installer.h" 10 #include "chrome/browser/extensions/crx_installer.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 web_app_info.icons.push_back(icon_info); 110 web_app_info.icons.push_back(icon_info);
111 } 111 }
112 callback.Run(web_app_info); 112 callback.Run(web_app_info);
113 } 113 }
114 114
115 std::set<int> SizesToGenerate() { 115 std::set<int> SizesToGenerate() {
116 // Generate container icons from smaller icons. 116 // Generate container icons from smaller icons.
117 const int kIconSizesToGenerate[] = { 117 const int kIconSizesToGenerate[] = {
118 extension_misc::EXTENSION_ICON_SMALL, 118 extension_misc::EXTENSION_ICON_SMALL,
119 extension_misc::EXTENSION_ICON_MEDIUM, 119 extension_misc::EXTENSION_ICON_MEDIUM,
120 extension_misc::EXTENSION_ICON_LARGE,
120 }; 121 };
121 return std::set<int>(kIconSizesToGenerate, 122 return std::set<int>(kIconSizesToGenerate,
122 kIconSizesToGenerate + arraysize(kIconSizesToGenerate)); 123 kIconSizesToGenerate + arraysize(kIconSizesToGenerate));
123 } 124 }
124 125
125 void GenerateIcons(std::set<int> generate_sizes, 126 void GenerateIcons(std::set<int> generate_sizes,
126 const GURL& app_url, 127 const GURL& app_url,
127 SkColor generated_icon_color, 128 SkColor generated_icon_color,
128 std::map<int, SkBitmap>* bitmap_map) { 129 std::map<int, SkBitmap>* bitmap_map) {
129 // The letter that will be painted on the generated icon. 130 // The letter that will be painted on the generated icon.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); 411 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback));
411 } 412 }
412 413
413 bool IsValidBookmarkAppUrl(const GURL& url) { 414 bool IsValidBookmarkAppUrl(const GURL& url) {
414 URLPattern origin_only_pattern(Extension::kValidWebExtentSchemes); 415 URLPattern origin_only_pattern(Extension::kValidWebExtentSchemes);
415 origin_only_pattern.SetMatchAllURLs(true); 416 origin_only_pattern.SetMatchAllURLs(true);
416 return url.is_valid() && origin_only_pattern.MatchesURL(url); 417 return url.is_valid() && origin_only_pattern.MatchesURL(url);
417 } 418 }
418 419
419 } // namespace extensions 420 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/management/test/generateAppForLink.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698