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

Unified Diff: components/web_contents_delegate_android/validation_message_bubble_android.cc

Issue 2877483003: Implements core logic for Pixel Canvas (Closed)
Patch Set: Sync with ToT Created 3 years, 4 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 | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | content/browser/compositor/reflector_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/web_contents_delegate_android/validation_message_bubble_android.cc
diff --git a/components/web_contents_delegate_android/validation_message_bubble_android.cc b/components/web_contents_delegate_android/validation_message_bubble_android.cc
index 2f15a5e5c688fe346e6ea5494964c856c2a63df6..edfb81d0f1ef8f21d35c29ac4f3580e706dddc5c 100644
--- a/components/web_contents_delegate_android/validation_message_bubble_android.cc
+++ b/components/web_contents_delegate_android/validation_message_bubble_android.cc
@@ -14,13 +14,6 @@
using base::android::ConvertUTF16ToJavaString;
namespace {
-
-gfx::Rect ScaleToRoundedRect(const gfx::Rect& rect, float scale) {
- gfx::RectF scaledRect(rect);
- scaledRect.Scale(scale);
- return ToNearestRect(scaledRect);
-}
-
gfx::Size ScaleToRoundedSize(const gfx::SizeF& size, float scale) {
return gfx::ToRoundedSize(gfx::ScaleSize(size, scale));
}
@@ -55,7 +48,9 @@ void ValidationMessageBubbleAndroid::ShowAtPositionRelativeToAnchor(
// Convert to physical unit before passing to Java.
float scale = view->GetDipScale() * view->page_scale();
- gfx::Rect anchor = ScaleToRoundedRect(anchor_in_screen, scale);
+ gfx::RectF anchor_f = gfx::RectF(anchor_in_screen);
+ anchor_f.Scale(scale);
+ gfx::Rect anchor = ToNearestRect(anchor_f);
gfx::Size viewport = ScaleToRoundedSize(view->viewport_size(), scale);
JNIEnv* env = base::android::AttachCurrentThread();
« no previous file with comments | « chrome/browser/ui/views/tabs/tab_strip.cc ('k') | content/browser/compositor/reflector_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698