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

Unified Diff: chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc

Issue 1164063005: Replace gfx::ClampToInt with base::saturated_cast. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clamp: . Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/numerics/safe_numerics_unittest.cc ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc
diff --git a/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc b/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc
index 46f8d15f3b2ab4e27c137782375da1760d0c5009..0b3fede7c23e1f9edf95de65abbd7c3ec8a8b214 100644
--- a/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc
+++ b/chrome/browser/ui/views/extensions/bookmark_app_bubble_view.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/views/extensions/bookmark_app_bubble_view.h"
+#include "base/numerics/safe_conversions.h"
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -15,7 +16,6 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/events/keycodes/keyboard_codes.h"
-#include "ui/gfx/geometry/safe_integer_conversions.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/image/image_skia_source.h"
#include "ui/views/controls/button/checkbox.h"
@@ -47,7 +47,7 @@ class WebAppInfoImageSource : public gfx::ImageSkiaSource {
private:
gfx::ImageSkiaRep GetImageForScale(float scale) override {
- int size = gfx::ClampToInt(dip_size_ * scale);
+ int size = base::saturated_cast<int>(dip_size_ * scale);
for (const auto& icon_info : info_.icons) {
if (icon_info.width == size) {
return gfx::ImageSkiaRep(icon_info.data, scale);
« no previous file with comments | « base/numerics/safe_numerics_unittest.cc ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698