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

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

Issue 10702030: Move fullscreen_controller* to a subdirectory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge tot Created 8 years, 5 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_FULLSCREEN_EXIT_BUBBLE_H_
6 #define CHROME_BROWSER_UI_FULLSCREEN_EXIT_BUBBLE_H_
7 #pragma once
8
9 #include "base/timer.h"
10 #include "chrome/browser/command_updater.h"
11 #include "chrome/browser/ui/fullscreen_exit_bubble_type.h"
12 #include "googleurl/src/gurl.h"
13 #include "ui/base/animation/animation_delegate.h"
14 #include "ui/gfx/point.h"
15
16 class Browser;
17
18 namespace gfx {
19 class Rect;
20 }
21
22 class FullscreenExitBubble : public ui::AnimationDelegate {
23 public:
24 explicit FullscreenExitBubble(Browser* browser,
25 const GURL& url,
26 FullscreenExitBubbleType bubble_type);
27 virtual ~FullscreenExitBubble();
28
29 protected:
30 static const int kPaddingPx; // Amount of padding around the link
31 static const int kInitialDelayMs; // Initial time bubble remains onscreen
32 static const int kIdleTimeMs; // Time before mouse idle triggers hide
33 static const int kPositionCheckHz; // How fast to check the mouse position
34 static const int kSlideInRegionHeightPx;
35 // Height of region triggering
36 // slide-in
37 static const int kPopupTopPx; // Space between the popup and the top
38 // of the screen.
39 static const int kSlideInDurationMs; // Duration of slide-in animation
40 static const int kSlideOutDurationMs; // Duration of slide-out animation
41
42 // Returns the current desirable rect for the popup window. If
43 // |ignore_animation_state| is true this returns the rect assuming the popup
44 // is fully onscreen.
45 virtual gfx::Rect GetPopupRect(bool ignore_animation_state) const = 0;
46 virtual gfx::Point GetCursorScreenPoint() = 0;
47 virtual bool WindowContainsPoint(gfx::Point pos) = 0;
48
49 // Returns true if the window is active.
50 virtual bool IsWindowActive() = 0;
51
52 // Hides the bubble. This is a separate function so it can be called by a
53 // timer.
54 virtual void Hide() = 0;
55
56 // Shows the bubble.
57 virtual void Show() = 0;
58
59 virtual bool IsAnimating() = 0;
60
61 // Called repeatedly to get the current mouse position and animate the bubble
62 // on or off the screen as appropriate.
63 void CheckMousePosition();
64
65 void StartWatchingMouse();
66 void StopWatchingMouse();
67
68 void ToggleFullscreen();
69 void Accept();
70 void Cancel();
71
72 // The following strings may change according to the content type and URL.
73 string16 GetCurrentMessageText() const;
74 string16 GetCurrentDenyButtonText() const;
75
76 // The following strings never change.
77 string16 GetAllowButtonText() const;
78 string16 GetInstructionText() const;
79
80 // The browser this bubble is in.
81 Browser* browser_;
82
83 private:
84 // Timer to delay before allowing the bubble to hide after it's initially
85 // shown.
86 base::OneShotTimer<FullscreenExitBubble> initial_delay_;
87
88 // Timer to see how long the mouse has been idle.
89 base::OneShotTimer<FullscreenExitBubble> idle_timeout_;
90
91 // Timer to poll the current mouse position. We can't just listen for mouse
92 // events without putting a non-empty HWND onscreen (or hooking Windows, which
93 // has other problems), so instead we run a low-frequency poller to see if the
94 // user has moved in or out of our show/hide regions.
95 base::RepeatingTimer<FullscreenExitBubble> mouse_position_checker_;
96
97 // The most recently seen mouse position, in screen coordinates. Used to see
98 // if the mouse has moved since our last check.
99 gfx::Point last_mouse_pos_;
100
101 protected:
102 // The host the bubble is for, can be empty.
103 GURL url_;
104
105 // The type of the bubble; controls e.g. which buttons to show.
106 FullscreenExitBubbleType bubble_type_;
107 };
108
109 #endif // CHROME_BROWSER_UI_FULLSCREEN_EXIT_BUBBLE_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/fullscreen_controller_test.cc ('k') | chrome/browser/ui/fullscreen_exit_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698