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

Side by Side Diff: chrome/browser/ui/views/fullscreen_exit_bubble.h

Issue 6154001: Move animation code to new ui/base/animation directory.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_FULLSCREEN_EXIT_BUBBLE_H__ 5 #ifndef CHROME_BROWSER_UI_VIEWS_FULLSCREEN_EXIT_BUBBLE_H__
6 #define CHROME_BROWSER_UI_VIEWS_FULLSCREEN_EXIT_BUBBLE_H__ 6 #define CHROME_BROWSER_UI_VIEWS_FULLSCREEN_EXIT_BUBBLE_H__
7 #pragma once 7 #pragma once
8 8
9 #include "app/animation_delegate.h"
10 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
11 #include "base/timer.h" 10 #include "base/timer.h"
12 #include "chrome/browser/command_updater.h" 11 #include "chrome/browser/command_updater.h"
12 #include "ui/base/animation/animation_delegate.h"
13 #include "views/controls/link.h" 13 #include "views/controls/link.h"
14 14
15 namespace ui {
16 class SlideAnimation;
17 }
18
15 #if defined(OS_LINUX) 19 #if defined(OS_LINUX)
16 namespace views { 20 namespace views {
17 class WidgetGtk; 21 class WidgetGtk;
18 } 22 }
19 #endif 23 #endif
20 24
21 class SlideAnimation;
22
23 // FullscreenExitBubble is responsible for showing a bubble atop the screen in 25 // FullscreenExitBubble is responsible for showing a bubble atop the screen in
24 // fullscreen mode, telling users how to exit and providing a click target. 26 // fullscreen mode, telling users how to exit and providing a click target.
25 // The bubble auto-hides, and re-shows when the user moves to the screen top. 27 // The bubble auto-hides, and re-shows when the user moves to the screen top.
26 28
27 class FullscreenExitBubble : public views::LinkController, 29 class FullscreenExitBubble : public views::LinkController,
28 public AnimationDelegate { 30 public ui::AnimationDelegate {
29 public: 31 public:
30 explicit FullscreenExitBubble( 32 explicit FullscreenExitBubble(
31 views::Widget* frame, 33 views::Widget* frame,
32 CommandUpdater::CommandUpdaterDelegate* delegate); 34 CommandUpdater::CommandUpdaterDelegate* delegate);
33 virtual ~FullscreenExitBubble(); 35 virtual ~FullscreenExitBubble();
34 36
35 private: 37 private:
36 class FullscreenExitView; 38 class FullscreenExitView;
37 class FullscreenExitPopup; 39 class FullscreenExitPopup;
38 40
39 static const double kOpacity; // Opacity of the bubble, 0.0 - 1.0 41 static const double kOpacity; // Opacity of the bubble, 0.0 - 1.0
40 static const int kInitialDelayMs; // Initial time bubble remains onscreen 42 static const int kInitialDelayMs; // Initial time bubble remains onscreen
41 static const int kIdleTimeMs; // Time before mouse idle triggers hide 43 static const int kIdleTimeMs; // Time before mouse idle triggers hide
42 static const int kPositionCheckHz; // How fast to check the mouse position 44 static const int kPositionCheckHz; // How fast to check the mouse position
43 static const int kSlideInRegionHeightPx; 45 static const int kSlideInRegionHeightPx;
44 // Height of region triggering slide-in 46 // Height of region triggering slide-in
45 static const int kSlideInDurationMs; // Duration of slide-in animation 47 static const int kSlideInDurationMs; // Duration of slide-in animation
46 static const int kSlideOutDurationMs; // Duration of slide-out animation 48 static const int kSlideOutDurationMs; // Duration of slide-out animation
47 49
48 // views::LinkController 50 // views::LinkController
49 virtual void LinkActivated(views::Link* source, int event_flags); 51 virtual void LinkActivated(views::Link* source, int event_flags);
50 52
51 // AnimationDelegate 53 // ui::AnimationDelegate
52 virtual void AnimationProgressed(const Animation* animation); 54 virtual void AnimationProgressed(const ui::Animation* animation);
53 virtual void AnimationEnded(const Animation* animation); 55 virtual void AnimationEnded(const ui::Animation* animation);
54 56
55 // Called repeatedly to get the current mouse position and animate the bubble 57 // Called repeatedly to get the current mouse position and animate the bubble
56 // on or off the screen as appropriate. 58 // on or off the screen as appropriate.
57 void CheckMousePosition(); 59 void CheckMousePosition();
58 60
59 // Hides the bubble. This is a separate function so it can be called by a 61 // Hides the bubble. This is a separate function so it can be called by a
60 // timer. 62 // timer.
61 void Hide(); 63 void Hide();
62 64
63 // Returns the current desirable rect for the popup window. If 65 // Returns the current desirable rect for the popup window. If
(...skipping 13 matching lines...) Expand all
77 // a WidgetWin (and thus an HWND) to make the popup float over other HWNDs. 79 // a WidgetWin (and thus an HWND) to make the popup float over other HWNDs.
78 FullscreenExitPopup* popup_; 80 FullscreenExitPopup* popup_;
79 #elif defined(OS_LINUX) 81 #elif defined(OS_LINUX)
80 views::WidgetGtk* popup_; 82 views::WidgetGtk* popup_;
81 #endif 83 #endif
82 84
83 // The contents of the popup. 85 // The contents of the popup.
84 FullscreenExitView* view_; 86 FullscreenExitView* view_;
85 87
86 // Animation controlling sliding into/out of the top of the screen. 88 // Animation controlling sliding into/out of the top of the screen.
87 scoped_ptr<SlideAnimation> size_animation_; 89 scoped_ptr<ui::SlideAnimation> size_animation_;
88 90
89 // Timer to delay before allowing the bubble to hide after it's initially 91 // Timer to delay before allowing the bubble to hide after it's initially
90 // shown. 92 // shown.
91 base::OneShotTimer<FullscreenExitBubble> initial_delay_; 93 base::OneShotTimer<FullscreenExitBubble> initial_delay_;
92 94
93 // Timer to see how long the mouse has been idle. 95 // Timer to see how long the mouse has been idle.
94 base::OneShotTimer<FullscreenExitBubble> idle_timeout_; 96 base::OneShotTimer<FullscreenExitBubble> idle_timeout_;
95 97
96 // Timer to poll the current mouse position. We can't just listen for mouse 98 // Timer to poll the current mouse position. We can't just listen for mouse
97 // events without putting a non-empty HWND onscreen (or hooking Windows, which 99 // events without putting a non-empty HWND onscreen (or hooking Windows, which
98 // has other problems), so instead we run a low-frequency poller to see if the 100 // has other problems), so instead we run a low-frequency poller to see if the
99 // user has moved in or out of our show/hide regions. 101 // user has moved in or out of our show/hide regions.
100 base::RepeatingTimer<FullscreenExitBubble> mouse_position_checker_; 102 base::RepeatingTimer<FullscreenExitBubble> mouse_position_checker_;
101 103
102 // The most recently seen mouse position, in screen coordinates. Used to see 104 // The most recently seen mouse position, in screen coordinates. Used to see
103 // if the mouse has moved since our last check. 105 // if the mouse has moved since our last check.
104 gfx::Point last_mouse_pos_; 106 gfx::Point last_mouse_pos_;
105 107
106 DISALLOW_COPY_AND_ASSIGN(FullscreenExitBubble); 108 DISALLOW_COPY_AND_ASSIGN(FullscreenExitBubble);
107 }; 109 };
108 110
109 #endif // CHROME_BROWSER_UI_VIEWS_FULLSCREEN_EXIT_BUBBLE_H__ 111 #endif // CHROME_BROWSER_UI_VIEWS_FULLSCREEN_EXIT_BUBBLE_H__
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/contents_container.cc ('k') | chrome/browser/ui/views/fullscreen_exit_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698