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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_android.cc

Issue 377013002: android: Use UIResource for overscroll glow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/renderer_host/render_widget_host_view_android.h" 5 #include "content/browser/renderer_host/render_widget_host_view_android.h"
6 6
7 #include <android/bitmap.h> 7 #include <android/bitmap.h>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
1224 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const { 1224 SkColor RenderWidgetHostViewAndroid::GetCachedBackgroundColor() const {
1225 return cached_background_color_; 1225 return cached_background_color_;
1226 } 1226 }
1227 1227
1228 void RenderWidgetHostViewAndroid::DidOverscroll( 1228 void RenderWidgetHostViewAndroid::DidOverscroll(
1229 const DidOverscrollParams& params) { 1229 const DidOverscrollParams& params) {
1230 if (!content_view_core_ || !layer_ || !is_showing_) 1230 if (!content_view_core_ || !layer_ || !is_showing_)
1231 return; 1231 return;
1232 1232
1233 const float device_scale_factor = content_view_core_->GetDpiScale(); 1233 const float device_scale_factor = content_view_core_->GetDpiScale();
1234
1235 cc::UIResourceId edge_ui_resource =
1236 content_view_core_->GetWindowAndroid()->GetSystemUIResource(
1237 ui::WindowAndroid::OVERSCROLL_EDGE);
1238 cc::UIResourceId glow_ui_resource =
1239 content_view_core_->GetWindowAndroid()->GetSystemUIResource(
1240 ui::WindowAndroid::OVERSCROLL_GLOW);
1241
1234 if (overscroll_effect_->OnOverscrolled( 1242 if (overscroll_effect_->OnOverscrolled(
1235 content_view_core_->GetLayer(), 1243 content_view_core_->GetLayer(),
1236 base::TimeTicks::Now(), 1244 base::TimeTicks::Now(),
1245 edge_ui_resource,
1246 glow_ui_resource,
1237 gfx::ScaleVector2d(params.accumulated_overscroll, 1247 gfx::ScaleVector2d(params.accumulated_overscroll,
1238 device_scale_factor), 1248 device_scale_factor),
1239 gfx::ScaleVector2d(params.latest_overscroll_delta, 1249 gfx::ScaleVector2d(params.latest_overscroll_delta,
1240 device_scale_factor), 1250 device_scale_factor),
1241 gfx::ScaleVector2d(params.current_fling_velocity, 1251 gfx::ScaleVector2d(params.current_fling_velocity,
1242 device_scale_factor))) { 1252 device_scale_factor))) {
1243 SetNeedsAnimate(); 1253 SetNeedsAnimate();
1244 } 1254 }
1245 } 1255 }
1246 1256
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
1481 results->orientationAngle = display.RotationAsDegree(); 1491 results->orientationAngle = display.RotationAsDegree();
1482 results->orientationType = 1492 results->orientationType =
1483 RenderWidgetHostViewBase::GetOrientationTypeFromDisplay(display); 1493 RenderWidgetHostViewBase::GetOrientationTypeFromDisplay(display);
1484 gfx::DeviceDisplayInfo info; 1494 gfx::DeviceDisplayInfo info;
1485 results->depth = info.GetBitsPerPixel(); 1495 results->depth = info.GetBitsPerPixel();
1486 results->depthPerComponent = info.GetBitsPerComponent(); 1496 results->depthPerComponent = info.GetBitsPerComponent();
1487 results->isMonochrome = (results->depthPerComponent == 0); 1497 results->isMonochrome = (results->depthPerComponent == 0);
1488 } 1498 }
1489 1499
1490 } // namespace content 1500 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698