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

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

Issue 7740044: Implement fullscreen info bubble on Win and Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix ups Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/fullscreen_exit_bubble.h" 5 #include "chrome/browser/ui/fullscreen_exit_bubble.h"
6 6
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/ui/browser.h"
8 #include "ui/gfx/rect.h" 9 #include "ui/gfx/rect.h"
9 10
10 const double FullscreenExitBubble::kOpacity = 0.7; 11 const double FullscreenExitBubble::kOpacity = 0.7;
11 const int FullscreenExitBubble::kPaddingPx = 8; 12 const int FullscreenExitBubble::kPaddingPx = 8;
12 const int FullscreenExitBubble::kInitialDelayMs = 3800; 13 const int FullscreenExitBubble::kInitialDelayMs = 3800;
13 const int FullscreenExitBubble::kIdleTimeMs = 2300; 14 const int FullscreenExitBubble::kIdleTimeMs = 2300;
14 const int FullscreenExitBubble::kPositionCheckHz = 10; 15 const int FullscreenExitBubble::kPositionCheckHz = 10;
15 const int FullscreenExitBubble::kSlideInRegionHeightPx = 4; 16 const int FullscreenExitBubble::kSlideInRegionHeightPx = 4;
16 const int FullscreenExitBubble::kSlideInDurationMs = 350; 17 const int FullscreenExitBubble::kSlideInDurationMs = 350;
17 const int FullscreenExitBubble::kSlideOutDurationMs = 700; 18 const int FullscreenExitBubble::kSlideOutDurationMs = 700;
19 const int FullscreenExitBubble::kPopupTopPx = 15;
18 20
19 FullscreenExitBubble::FullscreenExitBubble( 21 FullscreenExitBubble::FullscreenExitBubble(Browser* browser)
20 CommandUpdater::CommandUpdaterDelegate* delegate) 22 : browser_(browser) {
21 : delegate_(delegate) {
22 } 23 }
23 24
24 FullscreenExitBubble::~FullscreenExitBubble() { 25 FullscreenExitBubble::~FullscreenExitBubble() {
25 } 26 }
26 27
27 void FullscreenExitBubble::StartWatchingMouse() { 28 void FullscreenExitBubble::StartWatchingMouse() {
28 // Start the initial delay timer and begin watching the mouse. 29 // Start the initial delay timer and begin watching the mouse.
29 initial_delay_.Start(FROM_HERE, 30 initial_delay_.Start(FROM_HERE,
30 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this, 31 base::TimeDelta::FromMilliseconds(kInitialDelayMs), this,
31 &FullscreenExitBubble::CheckMousePosition); 32 &FullscreenExitBubble::CheckMousePosition);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 80 }
80 } else if ((cursor_pos.y() < kSlideInRegionHeightPx) || 81 } else if ((cursor_pos.y() < kSlideInRegionHeightPx) ||
81 IsAnimating()) { 82 IsAnimating()) {
82 // The cursor is not idle, and either it's in the slide-in region or it's in 83 // The cursor is not idle, and either it's in the slide-in region or it's in
83 // the neutral region and we're sliding out. 84 // the neutral region and we're sliding out.
84 Show(); 85 Show();
85 } 86 }
86 } 87 }
87 88
88 void FullscreenExitBubble::ToggleFullscreen() { 89 void FullscreenExitBubble::ToggleFullscreen() {
89 delegate_->ExecuteCommand(IDC_FULLSCREEN); 90 browser_->ExecuteCommand(IDC_FULLSCREEN);
90 } 91 }
92
93 void FullscreenExitBubble::AcceptFullscreen(const GURL& url) {
94 browser_->OnAcceptFullscreenPermission(url);
95 }
96
97 void FullscreenExitBubble::CancelFullscreen() {
98 browser_->OnDenyFullscreenPermission();
99 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698