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

Side by Side Diff: extensions/common/image_util.cc

Issue 1544433002: Replace RE2 import with a dependency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Re-Added LICENSE and OWNERS file Created 5 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 "extensions/common/image_util.h" 5 #include "extensions/common/image_util.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "third_party/re2/re2/re2.h" 13 #include "third_party/re2/src/re2/re2.h"
14 #include "third_party/skia/include/core/SkColor.h" 14 #include "third_party/skia/include/core/SkColor.h"
15 #include "ui/gfx/color_utils.h" 15 #include "ui/gfx/color_utils.h"
16 16
17 namespace extensions { 17 namespace extensions {
18 namespace image_util { 18 namespace image_util {
19 19
20 bool ParseCssColorString(const std::string& color_string, SkColor* result) { 20 bool ParseCssColorString(const std::string& color_string, SkColor* result) {
21 if (color_string.empty()) 21 if (color_string.empty())
22 return false; 22 return false;
23 if (color_string[0] == '#') 23 if (color_string[0] == '#')
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 hsl.l = std::max(0.0, std::min(100.0, lightness)) / 100.0; 93 hsl.l = std::max(0.0, std::min(100.0, lightness)) / 100.0;
94 94
95 SkAlpha sk_alpha = std::max(0.0, std::min(1.0, alpha)) * 255; 95 SkAlpha sk_alpha = std::max(0.0, std::min(1.0, alpha)) * 255;
96 96
97 *result = color_utils::HSLToSkColor(hsl, sk_alpha); 97 *result = color_utils::HSLToSkColor(hsl, sk_alpha);
98 return true; 98 return true;
99 } 99 }
100 100
101 } // namespace image_util 101 } // namespace image_util
102 } // namespace extensions 102 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/web_request/form_data_parser.cc ('k') | extensions/common/stack_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698