OLD | NEW |
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 15 matching lines...) Expand all Loading... |
26 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 26 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
27 #include "skia/ext/image_operations.h" | 27 #include "skia/ext/image_operations.h" |
28 #include "skia/ext/platform_canvas.h" | 28 #include "skia/ext/platform_canvas.h" |
29 #include "third_party/skia/include/core/SkBitmap.h" | 29 #include "third_party/skia/include/core/SkBitmap.h" |
30 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
31 #include "ui/gfx/canvas.h" | 31 #include "ui/gfx/canvas.h" |
32 #include "ui/gfx/color_analysis.h" | 32 #include "ui/gfx/color_analysis.h" |
33 #include "ui/gfx/color_utils.h" | 33 #include "ui/gfx/color_utils.h" |
34 #include "ui/gfx/font.h" | 34 #include "ui/gfx/font.h" |
35 #include "ui/gfx/font_list.h" | 35 #include "ui/gfx/font_list.h" |
| 36 #include "ui/gfx/geometry/rect.h" |
36 #include "ui/gfx/image/canvas_image_source.h" | 37 #include "ui/gfx/image/canvas_image_source.h" |
37 #include "ui/gfx/image/image.h" | 38 #include "ui/gfx/image/image.h" |
38 #include "ui/gfx/image/image_family.h" | 39 #include "ui/gfx/image/image_family.h" |
39 #include "ui/gfx/rect.h" | |
40 | 40 |
41 namespace { | 41 namespace { |
42 | 42 |
43 // Overlays a shortcut icon over the bottom left corner of a given image. | 43 // Overlays a shortcut icon over the bottom left corner of a given image. |
44 class GeneratedIconImageSource : public gfx::CanvasImageSource { | 44 class GeneratedIconImageSource : public gfx::CanvasImageSource { |
45 public: | 45 public: |
46 explicit GeneratedIconImageSource(char letter, SkColor color, int output_size) | 46 explicit GeneratedIconImageSource(char letter, SkColor color, int output_size) |
47 : gfx::CanvasImageSource(gfx::Size(output_size, output_size), false), | 47 : gfx::CanvasImageSource(gfx::Size(output_size, output_size), false), |
48 letter_(letter), | 48 letter_(letter), |
49 color_(color), | 49 color_(color), |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); | 410 extension, info_list, base::Bind(&OnIconsLoaded, web_app_info, callback)); |
411 } | 411 } |
412 | 412 |
413 bool IsValidBookmarkAppUrl(const GURL& url) { | 413 bool IsValidBookmarkAppUrl(const GURL& url) { |
414 URLPattern origin_only_pattern(Extension::kValidWebExtentSchemes); | 414 URLPattern origin_only_pattern(Extension::kValidWebExtentSchemes); |
415 origin_only_pattern.SetMatchAllURLs(true); | 415 origin_only_pattern.SetMatchAllURLs(true); |
416 return url.is_valid() && origin_only_pattern.MatchesURL(url); | 416 return url.is_valid() && origin_only_pattern.MatchesURL(url); |
417 } | 417 } |
418 | 418 |
419 } // namespace extensions | 419 } // namespace extensions |
OLD | NEW |