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

Unified Diff: chrome/browser/ui/views/ash/tab_scrubber.h

Issue 11881042: highlight intermediate tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make check for Gesture vs Scroll event for flings explicit Created 7 years, 11 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: chrome/browser/ui/views/ash/tab_scrubber.h
diff --git a/chrome/browser/ui/views/ash/tab_scrubber.h b/chrome/browser/ui/views/ash/tab_scrubber.h
index 8ba03d5d6b30781663d9965561fa952e0c1a53c9..4cf7c5352bcdd918eaf6df4c6825fb7c4f347ee5 100644
--- a/chrome/browser/ui/views/ash/tab_scrubber.h
+++ b/chrome/browser/ui/views/ash/tab_scrubber.h
@@ -5,12 +5,18 @@
#ifndef CHROME_BROWSER_UI_VIEWS_ASH_TAB_SCRUBBER_H_
#define CHROME_BROWSER_UI_VIEWS_ASH_TAB_SCRUBBER_H_
+#include "base/timer.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "ui/base/animation/animation_delegate.h"
#include "ui/base/events/event_handler.h"
class Browser;
-class Tab;
+class TabStrip;
+
+namespace gfx {
+class Point;
+}
// Class to enable quick tab switching via Ctrl-left-drag.
// Notes: this is experimental, and disables ctrl-clicks. It should not be
@@ -21,6 +27,18 @@ class TabScrubber : public ui::EventHandler,
public:
static TabScrubber* GetInstance();
+ enum Direction {LEFT, RIGHT};
sky 2013/01/22 18:05:01 enums before methods. Also, how does this with whe
DaveMoore 2013/01/27 21:21:54 Moved declaration, but I think RIGHT / LEFT here m
+
+ // Returns the virtual position of a swipe starting in the tab at |index|,
+ // base on the |direction|.
+ static const gfx::Point GetStartPoint(TabStrip* tab_strip,
sky 2013/01/22 18:05:01 No point in a const return type.
DaveMoore 2013/01/27 21:21:54 Done.
+ int index,
+ TabScrubber::Direction direction);
+ void set_activation_delay(base::TimeDelta activation_delay) {
+ activation_delay_ = activation_delay;
+ }
+ base::TimeDelta activation_delay() const { return activation_delay_; }
+
private:
TabScrubber();
virtual ~TabScrubber();
@@ -34,19 +52,26 @@ class TabScrubber : public ui::EventHandler,
const content::NotificationDetails& details) OVERRIDE;
Browser* GetActiveBrowser();
- void StartScrubbing();
- void StopScrubbing();
+ void FinishScrub(bool activate);
+ void CancelImmersiveReveal();
- // Indicates that we are currently scrubbing.
- bool scrubbing_;
// The browser that we are scrubbing.
sky 2013/01/22 18:05:01 Update comments for members below. Not all members
DaveMoore 2013/01/27 21:21:54 Done.
+ bool scrubbing_;
Browser* browser_;
- // The x value of the event that initiated scrubbing.
- float scroll_x_;
- float scroll_y_;
-
+ float swipe_x_;
+ float swipe_y_;
+ Direction swipe_direction_;
sky 2013/01/22 18:05:01 You don't member initialize this.
DaveMoore 2013/01/27 21:21:54 Done.
DaveMoore 2013/01/27 21:21:54 Done.
content::NotificationRegistrar registrar_;
+ int overridden_tab_;
+ base::Timer activate_timer_;
+ // Time to wait before newly selected tab becomes active.
+ base::TimeDelta activation_delay_;
+ bool should_cancel_immersive_reveal_;
+ base::Timer cancel_immersive_reveal_timer_;
+ // Note: This should remain the last member so it'll be destroyed and
+ // invalidate its weak pointers before any other members are destroyed.
+ base::WeakPtrFactory<TabScrubber> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(TabScrubber);
sky 2013/01/22 18:05:01 nit: newline between 74/75
DaveMoore 2013/01/27 21:21:54 Done.
};

Powered by Google App Engine
This is Rietveld 408576698