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

Side by Side Diff: content/browser/android/edge_effect_l.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
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 "content/browser/android/edge_effect_l.h" 5 #include "content/browser/android/edge_effect_l.h"
6 6
7 #include "cc/layers/ui_resource_layer.h" 7 #include "cc/layers/ui_resource_layer.h"
8 #include "content/browser/android/animation_utils.h" 8 #include "content/browser/android/animation_utils.h"
9 #include "ui/android/resources/resource_manager.h" 9 #include "ui/android/resources/resource_manager.h"
10 #include "ui/android/resources/system_ui_resource_type.h" 10 #include "ui/android/resources/system_ui_resource_type.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 204
205 bool one_last_frame = false; 205 bool one_last_frame = false;
206 if (state_ == STATE_RECEDE && glow_scale_y_ <= 0) { 206 if (state_ == STATE_RECEDE && glow_scale_y_ <= 0) {
207 Finish(); 207 Finish();
208 one_last_frame = true; 208 one_last_frame = true;
209 } 209 }
210 210
211 return !IsFinished() || one_last_frame; 211 return !IsFinished() || one_last_frame;
212 } 212 }
213 213
214 float EdgeEffectL::GetAlpha() const {
215 return IsFinished() ? 0.f : glow_alpha_;
216 }
217
214 void EdgeEffectL::ApplyToLayers(const gfx::SizeF& size, 218 void EdgeEffectL::ApplyToLayers(const gfx::SizeF& size,
215 const gfx::Transform& transform) { 219 const gfx::Transform& transform) {
216 if (IsFinished()) 220 if (IsFinished())
217 return; 221 return;
218 222
219 // An empty window size, while meaningless, is also relatively harmless, and 223 // An empty window size, while meaningless, is also relatively harmless, and
220 // will simply prevent any drawing of the layers. 224 // will simply prevent any drawing of the layers.
221 if (size.IsEmpty()) { 225 if (size.IsEmpty()) {
222 glow_->SetIsDrawable(false); 226 glow_->SetIsDrawable(false);
223 return; 227 return;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 } 261 }
258 262
259 // static 263 // static
260 void EdgeEffectL::PreloadResources(ui::ResourceManager* resource_manager) { 264 void EdgeEffectL::PreloadResources(ui::ResourceManager* resource_manager) {
261 DCHECK(resource_manager); 265 DCHECK(resource_manager);
262 resource_manager->PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM, 266 resource_manager->PreloadResource(ui::ANDROID_RESOURCE_TYPE_SYSTEM,
263 kResourceId); 267 kResourceId);
264 } 268 }
265 269
266 } // namespace content 270 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/edge_effect_l.h ('k') | content/browser/android/overscroll_controller_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698