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

Unified Diff: cc/input/browser_controls_offset_manager.h

Issue 2443613002: Rename classes related to top controls (Closed)
Patch Set: Created 4 years, 2 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
Index: cc/input/browser_controls_offset_manager.h
diff --git a/cc/input/top_controls_manager.h b/cc/input/browser_controls_offset_manager.h
similarity index 62%
rename from cc/input/top_controls_manager.h
rename to cc/input/browser_controls_offset_manager.h
index fa0274b2333553c7dbf456543dbcce111af204f8..45f131cdc37a04e65673787f3d4b30769e22c2ef 100644
--- a/cc/input/top_controls_manager.h
+++ b/cc/input/browser_controls_offset_manager.h
@@ -1,16 +1,16 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
+// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CC_INPUT_TOP_CONTROLS_MANAGER_H_
-#define CC_INPUT_TOP_CONTROLS_MANAGER_H_
+#ifndef CC_INPUT_BROWSER_CONTROLS_OFFSET_MANAGER_H_
+#define CC_INPUT_BROWSER_CONTROLS_OFFSET_MANAGER_H_
#include <memory>
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
-#include "cc/input/top_controls_state.h"
+#include "cc/input/browser_controls_state.h"
#include "cc/layers/layer_impl.h"
#include "ui/gfx/geometry/size.h"
#include "ui/gfx/geometry/vector2d_f.h"
@@ -18,23 +18,19 @@
namespace cc {
class LayerTreeImpl;
-class TopControlsManagerClient;
+class BrowserControlsOffsetManagerClient;
-// Manages the position of the top controls.
-class CC_EXPORT TopControlsManager
- : public base::SupportsWeakPtr<TopControlsManager> {
+// Manages the position of the browser controls.
+class CC_EXPORT BrowserControlsOffsetManager
+ : public base::SupportsWeakPtr<BrowserControlsOffsetManager> {
public:
- enum AnimationDirection {
- NO_ANIMATION,
- SHOWING_CONTROLS,
- HIDING_CONTROLS
- };
-
- static std::unique_ptr<TopControlsManager> Create(
- TopControlsManagerClient* client,
- float top_controls_show_threshold,
- float top_controls_hide_threshold);
- virtual ~TopControlsManager();
+ enum AnimationDirection { NO_ANIMATION, SHOWING_CONTROLS, HIDING_CONTROLS };
+
+ static std::unique_ptr<BrowserControlsOffsetManager> Create(
+ BrowserControlsOffsetManagerClient* client,
+ float controls_show_threshold,
+ float controls_hide_threshold);
+ virtual ~BrowserControlsOffsetManager();
// The offset from the window top to the top edge of the controls. Runs from 0
// (controls fully shown) to negative values (down is positive).
@@ -56,8 +52,8 @@ class CC_EXPORT TopControlsManager
bool has_animation() const { return animation_direction_ != NO_ANIMATION; }
AnimationDirection animation_direction() { return animation_direction_; }
- void UpdateTopControlsState(TopControlsState constraints,
- TopControlsState current,
+ void UpdateTopControlsState(BrowserControlsState constraints,
vmpstr 2016/10/21 17:54:58 nit: UpdateBrowserControlsState
mdjones 2016/10/24 21:20:24 Done.
+ BrowserControlsState current,
bool animate);
void ScrollBegin();
@@ -74,9 +70,9 @@ class CC_EXPORT TopControlsManager
gfx::Vector2dF Animate(base::TimeTicks monotonic_time);
protected:
- TopControlsManager(TopControlsManagerClient* client,
- float top_controls_show_threshold,
- float top_controls_hide_threshold);
+ BrowserControlsOffsetManager(BrowserControlsOffsetManagerClient* client,
+ float controls_show_threshold,
+ float controls_hide_threshold);
private:
void ResetAnimations();
@@ -87,8 +83,8 @@ class CC_EXPORT TopControlsManager
// Offset computation regardless of top or bottom control state.
float ContentOffsetInternal() const;
- TopControlsManagerClient* client_; // The client manages the lifecycle of
- // this.
+ // The client manages the lifecycle of this.
+ BrowserControlsOffsetManagerClient* client_;
base::TimeTicks animation_start_time_;
float animation_start_value_;
@@ -96,7 +92,7 @@ class CC_EXPORT TopControlsManager
float animation_stop_value_;
AnimationDirection animation_direction_;
- TopControlsState permitted_state_;
+ BrowserControlsState permitted_state_;
// Accumulated scroll delta since last baseline reset
float accumulated_scroll_delta_;
@@ -104,19 +100,19 @@ class CC_EXPORT TopControlsManager
// Content offset when last baseline reset occurred
float baseline_content_offset_;
- // The percent height of the visible top control such that it must be shown
+ // The percent height of the visible control such that it must be shown
// when the user stops the scroll.
- float top_controls_show_threshold_;
+ float controls_show_threshold_;
- // The percent height of the visible top control such that it must be hidden
+ // The percent height of the visible control such that it must be hidden
// when the user stops the scroll.
- float top_controls_hide_threshold_;
+ float controls_hide_threshold_;
bool pinch_gesture_active_;
- DISALLOW_COPY_AND_ASSIGN(TopControlsManager);
+ DISALLOW_COPY_AND_ASSIGN(BrowserControlsOffsetManager);
};
} // namespace cc
-#endif // CC_INPUT_TOP_CONTROLS_MANAGER_H_
+#endif // CC_INPUT_BROWSER_CONTROLS_OFFSET_MANAGER_H_

Powered by Google App Engine
This is Rietveld 408576698