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

Side by Side Diff: chrome/browser/profiles/profile_avatar_icon_util.cc

Issue 823133004: Cleanup: Update the path to gfx rect headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rect_f.h 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
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/profiles/profile_avatar_icon_util.h" 5 #include "chrome/browser/profiles/profile_avatar_icon_util.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/format_macros.h" 8 #include "base/format_macros.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/stringprintf.h" 12 #include "base/strings/stringprintf.h"
13 #include "chrome/browser/browser_process.h" 13 #include "chrome/browser/browser_process.h"
14 #include "chrome/browser/profiles/profile_info_cache.h" 14 #include "chrome/browser/profiles/profile_info_cache.h"
15 #include "chrome/browser/profiles/profile_manager.h" 15 #include "chrome/browser/profiles/profile_manager.h"
16 #include "chrome/common/chrome_paths.h" 16 #include "chrome/common/chrome_paths.h"
17 #include "grit/theme_resources.h" 17 #include "grit/theme_resources.h"
18 #include "skia/ext/image_operations.h" 18 #include "skia/ext/image_operations.h"
19 #include "third_party/skia/include/core/SkPaint.h" 19 #include "third_party/skia/include/core/SkPaint.h"
20 #include "third_party/skia/include/core/SkPath.h" 20 #include "third_party/skia/include/core/SkPath.h"
21 #include "third_party/skia/include/core/SkScalar.h" 21 #include "third_party/skia/include/core/SkScalar.h"
22 #include "third_party/skia/include/core/SkXfermode.h" 22 #include "third_party/skia/include/core/SkXfermode.h"
23 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
24 #include "ui/gfx/canvas.h" 24 #include "ui/gfx/canvas.h"
25 #include "ui/gfx/geometry/rect.h"
25 #include "ui/gfx/image/canvas_image_source.h" 26 #include "ui/gfx/image/canvas_image_source.h"
26 #include "ui/gfx/image/image.h" 27 #include "ui/gfx/image/image.h"
27 #include "ui/gfx/image/image_skia_operations.h" 28 #include "ui/gfx/image/image_skia_operations.h"
28 #include "ui/gfx/rect.h"
29 #include "ui/gfx/skia_util.h" 29 #include "ui/gfx/skia_util.h"
30 30
31 // Helper methods for transforming and drawing avatar icons. 31 // Helper methods for transforming and drawing avatar icons.
32 namespace { 32 namespace {
33 33
34 // Determine what the scaled height of the avatar icon should be for a 34 // Determine what the scaled height of the avatar icon should be for a
35 // specified width, to preserve the aspect ratio. 35 // specified width, to preserve the aspect ratio.
36 int GetScaledAvatarHeightForWidth(int width, const gfx::ImageSkia& avatar) { 36 int GetScaledAvatarHeightForWidth(int width, const gfx::ImageSkia& avatar) {
37 // Multiply the width by the inverted aspect ratio (height over 37 // Multiply the width by the inverted aspect ratio (height over
38 // width), and then add 0.5 to ensure the int truncation rounds nicely. 38 // width), and then add 0.5 to ensure the int truncation rounds nicely.
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 int_value >= static_cast<int>(kDefaultAvatarIconsCount)) 386 int_value >= static_cast<int>(kDefaultAvatarIconsCount))
387 return false; 387 return false;
388 *icon_index = int_value; 388 *icon_index = int_value;
389 return true; 389 return true;
390 } 390 }
391 391
392 return false; 392 return false;
393 } 393 }
394 394
395 } // namespace profiles 395 } // namespace profiles
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_contents.cc ('k') | chrome/browser/renderer_context_menu/spelling_menu_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698