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

Side by Side Diff: chrome/browser/ui/views/ash/tab_scrubber.h

Issue 11568006: events: Update scroll and touch handlers to not return EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self-nit Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/workspace/workspace_cycler.cc ('k') | chrome/browser/ui/views/ash/tab_scrubber.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_TAB_SCRUBBER_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_ASH_TAB_SCRUBBER_H_
6 #define CHROME_BROWSER_UI_VIEWS_ASH_TAB_SCRUBBER_H_ 6 #define CHROME_BROWSER_UI_VIEWS_ASH_TAB_SCRUBBER_H_
7 7
8 #include "content/public/browser/notification_observer.h" 8 #include "content/public/browser/notification_observer.h"
9 #include "content/public/browser/notification_registrar.h" 9 #include "content/public/browser/notification_registrar.h"
10 #include "ui/base/events/event_handler.h" 10 #include "ui/base/events/event_handler.h"
11 11
12 class Browser; 12 class Browser;
13 class Tab; 13 class Tab;
14 14
15 // Class to enable quick tab switching via Ctrl-left-drag. 15 // Class to enable quick tab switching via Ctrl-left-drag.
16 // Notes: this is experimental, and disables ctrl-clicks. It should not be 16 // Notes: this is experimental, and disables ctrl-clicks. It should not be
17 // enabled other than through flags until we implement 3 finger drag as the 17 // enabled other than through flags until we implement 3 finger drag as the
18 // mechanism to invoke it. At that point we will add test coverage. 18 // mechanism to invoke it. At that point we will add test coverage.
19 class TabScrubber : public ui::EventHandler, 19 class TabScrubber : public ui::EventHandler,
20 public content::NotificationObserver { 20 public content::NotificationObserver {
21 public: 21 public:
22 static TabScrubber* GetInstance(); 22 static TabScrubber* GetInstance();
23 23
24 private: 24 private:
25 TabScrubber(); 25 TabScrubber();
26 virtual ~TabScrubber(); 26 virtual ~TabScrubber();
27 27
28 // ui::EventHandler overrides: 28 // ui::EventHandler overrides:
29 virtual ui::EventResult OnScrollEvent(ui::ScrollEvent* event) OVERRIDE; 29 virtual void OnScrollEvent(ui::ScrollEvent* event) OVERRIDE;
30 30
31 // content::NotificationObserver overrides: 31 // content::NotificationObserver overrides:
32 virtual void Observe(int type, 32 virtual void Observe(int type,
33 const content::NotificationSource& source, 33 const content::NotificationSource& source,
34 const content::NotificationDetails& details) OVERRIDE; 34 const content::NotificationDetails& details) OVERRIDE;
35 35
36 Browser* GetActiveBrowser(); 36 Browser* GetActiveBrowser();
37 void StartScrubbing(); 37 void StartScrubbing();
38 void StopScrubbing(); 38 void StopScrubbing();
39 39
40 // Indicates that we are currently scrubbing. 40 // Indicates that we are currently scrubbing.
41 bool scrubbing_; 41 bool scrubbing_;
42 // The browser that we are scrubbing. 42 // The browser that we are scrubbing.
43 Browser* browser_; 43 Browser* browser_;
44 // The x value of the event that initiated scrubbing. 44 // The x value of the event that initiated scrubbing.
45 float scroll_x_; 45 float scroll_x_;
46 float scroll_y_; 46 float scroll_y_;
47 47
48 content::NotificationRegistrar registrar_; 48 content::NotificationRegistrar registrar_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(TabScrubber); 50 DISALLOW_COPY_AND_ASSIGN(TabScrubber);
51 }; 51 };
52 52
53 #endif // CHROME_BROWSER_UI_VIEWS_ASH_TAB_SCRUBBER_H_ 53 #endif // CHROME_BROWSER_UI_VIEWS_ASH_TAB_SCRUBBER_H_
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_cycler.cc ('k') | chrome/browser/ui/views/ash/tab_scrubber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698