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

Side by Side Diff: cc/layers/layer_position_constraint.cc

Issue 12552004: Support bottom-right anchored fixed-position elements during a pinch gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 7 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/layers/layer_position_constraint.h"
6
7 #include "third_party/WebKit/Source/Platform/chromium/public/WebLayerPositionCon straint.h"
8
9 using WebKit::WebLayerPositionConstraint;
10
11 namespace cc {
12
13 LayerPositionConstraint::LayerPositionConstraint()
14 : is_fixed_position_(false),
15 is_fixed_to_right_edge_(false),
16 is_fixed_to_bottom_edge_(false) {
17 }
18
19 LayerPositionConstraint::LayerPositionConstraint(
20 const WebLayerPositionConstraint& constraint)
21 : is_fixed_position_(constraint.isFixedPosition),
22 is_fixed_to_right_edge_(constraint.isFixedToRightEdge),
23 is_fixed_to_bottom_edge_(constraint.isFixedToBottomEdge) {
24 }
25
26 bool LayerPositionConstraint::operator==(
27 const LayerPositionConstraint& other) const {
28 if (!is_fixed_position_ && !other.is_fixed_position_)
29 return true;
30 return is_fixed_position_ == other.is_fixed_position_ &&
31 is_fixed_to_right_edge_ == other.is_fixed_to_right_edge_ &&
32 is_fixed_to_bottom_edge_ == other.is_fixed_to_bottom_edge_;
33 }
34
35 bool LayerPositionConstraint::operator!=(
36 const LayerPositionConstraint& other) const {
37 return !(*this == other);
38 }
39
40 LayerPositionConstraint::operator WebLayerPositionConstraint() const {
41 WebLayerPositionConstraint constraint;
42 constraint.isFixedPosition = is_fixed_position_;
43 constraint.isFixedToRightEdge = is_fixed_to_right_edge_;
44 constraint.isFixedToBottomEdge = is_fixed_to_bottom_edge_;
45 return constraint;
46 }
47
48 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698