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

Side by Side Diff: content/browser/android/edge_effect.cc

Issue 993613007: [Android] Add slack to allow refresh after overscrolling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 5 years, 9 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
« no previous file with comments | « content/browser/android/edge_effect.h ('k') | content/browser/android/edge_effect_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/android/edge_effect.h" 5 #include "content/browser/android/edge_effect.h"
6 6
7 #include "cc/layers/layer.h" 7 #include "cc/layers/layer.h"
8 #include "cc/layers/ui_resource_layer.h" 8 #include "cc/layers/ui_resource_layer.h"
9 #include "content/browser/android/animation_utils.h" 9 #include "content/browser/android/animation_utils.h"
10 #include "ui/android/resources/resource_manager.h" 10 #include "ui/android/resources/resource_manager.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 break; 298 break;
299 } 299 }
300 } 300 }
301 301
302 if (state_ == STATE_RECEDE && glow_scale_y_ <= 0 && edge_scale_y_ <= 0) 302 if (state_ == STATE_RECEDE && glow_scale_y_ <= 0 && edge_scale_y_ <= 0)
303 Finish(); 303 Finish();
304 304
305 return !IsFinished(); 305 return !IsFinished();
306 } 306 }
307 307
308 float EdgeEffect::GetAlpha() const {
309 return IsFinished() ? 0.f : std::max(glow_alpha_, edge_alpha_);
310 }
311
308 void EdgeEffect::ApplyToLayers(const gfx::SizeF& size, 312 void EdgeEffect::ApplyToLayers(const gfx::SizeF& size,
309 const gfx::Transform& transform) { 313 const gfx::Transform& transform) {
310 if (IsFinished()) 314 if (IsFinished())
311 return; 315 return;
312 316
313 // An empty window size, while meaningless, is also relatively harmless, and 317 // An empty window size, while meaningless, is also relatively harmless, and
314 // will simply prevent any drawing of the layers. 318 // will simply prevent any drawing of the layers.
315 if (size.IsEmpty()) { 319 if (size.IsEmpty()) {
316 edge_->Disable(); 320 edge_->Disable();
317 glow_->Disable(); 321 glow_->Disable();
(...skipping 23 matching lines...) Expand all
341 // static 345 // static
342 void EdgeEffect::PreloadResources(ui::ResourceManager* resource_manager) { 346 void EdgeEffect::PreloadResources(ui::ResourceManager* resource_manager) {
343 DCHECK(resource_manager); 347 DCHECK(resource_manager);
344 resource_manager->PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM, 348 resource_manager->PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM,
345 kEdgeResourceId); 349 kEdgeResourceId);
346 resource_manager->PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM, 350 resource_manager->PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM,
347 kGlowResourceId); 351 kGlowResourceId);
348 } 352 }
349 353
350 } // namespace content 354 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/edge_effect.h ('k') | content/browser/android/edge_effect_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698