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

Side by Side Diff: chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm

Issue 10700071: browser: Remove fullscreen functions and have callers call FullscreenController directly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix 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
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 #import <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/logging.h" // for NOTREACHED() 7 #include "base/logging.h" // for NOTREACHED()
8 #include "base/mac/bundle_locations.h" 8 #include "base/mac/bundle_locations.h"
9 #include "base/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #include "base/sys_string_conversions.h" 10 #include "base/sys_string_conversions.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/app/chrome_command_ids.h" 12 #include "chrome/app/chrome_command_ids.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_commands.h" 14 #include "chrome/browser/ui/browser_commands.h"
15 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 15 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
16 #include "chrome/browser/ui/cocoa/event_utils.h" 16 #include "chrome/browser/ui/cocoa/event_utils.h"
17 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h" 17 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h"
18 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h" 18 #import "chrome/browser/ui/cocoa/hyperlink_text_view.h"
19 #import "chrome/browser/ui/cocoa/info_bubble_view.h" 19 #import "chrome/browser/ui/cocoa/info_bubble_view.h"
20 #import "chrome/browser/ui/cocoa/info_bubble_window.h" 20 #import "chrome/browser/ui/cocoa/info_bubble_window.h"
21 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h"
21 #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h" 22 #include "chrome/browser/ui/fullscreen/fullscreen_exit_bubble_type.h"
22 #include "chrome/browser/profiles/profile.h" 23 #include "chrome/browser/profiles/profile.h"
23 #include "chrome/browser/ui/tab_contents/tab_contents.h" 24 #include "chrome/browser/ui/tab_contents/tab_contents.h"
24 #include "grit/generated_resources.h" 25 #include "grit/generated_resources.h"
25 #include "grit/ui_strings.h" 26 #include "grit/ui_strings.h"
26 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" 27 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
27 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" 28 #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
28 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" 29 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
29 #include "ui/base/accelerators/accelerator_cocoa.h" 30 #include "ui/base/accelerators/accelerator_cocoa.h"
30 #include "ui/base/l10n/l10n_util.h" 31 #include "ui/base/l10n/l10n_util.h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 89
89 - (void)allow:(id)sender { 90 - (void)allow:(id)sender {
90 // The mouselock code expects that mouse events reach the main window 91 // The mouselock code expects that mouse events reach the main window
91 // immediately, but the cursor is still over the bubble, which eats the 92 // immediately, but the cursor is still over the bubble, which eats the
92 // mouse events. Make the bubble transparent for mouse events. 93 // mouse events. Make the bubble transparent for mouse events.
93 if (bubbleType_ == FEB_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS || 94 if (bubbleType_ == FEB_TYPE_FULLSCREEN_MOUSELOCK_BUTTONS ||
94 bubbleType_ == FEB_TYPE_MOUSELOCK_BUTTONS) 95 bubbleType_ == FEB_TYPE_MOUSELOCK_BUTTONS)
95 [[self window] setIgnoresMouseEvents:YES]; 96 [[self window] setIgnoresMouseEvents:YES];
96 97
97 DCHECK(fullscreen_bubble::ShowButtonsForType(bubbleType_)); 98 DCHECK(fullscreen_bubble::ShowButtonsForType(bubbleType_));
98 browser_->OnAcceptFullscreenPermission( 99 browser_->fullscreen_controller()->OnAcceptFullscreenPermission(
99 url_, bubbleType_); 100 url_, bubbleType_);
100 } 101 }
101 102
102 - (void)deny:(id)sender { 103 - (void)deny:(id)sender {
103 DCHECK(fullscreen_bubble::ShowButtonsForType(bubbleType_)); 104 DCHECK(fullscreen_bubble::ShowButtonsForType(bubbleType_));
104 browser_->OnDenyFullscreenPermission(bubbleType_); 105 browser_->fullscreen_controller()->OnDenyFullscreenPermission(bubbleType_);
105 } 106 }
106 107
107 - (void)showButtons:(BOOL)show { 108 - (void)showButtons:(BOOL)show {
108 [allowButton_ setHidden:!show]; 109 [allowButton_ setHidden:!show];
109 [denyButton_ setHidden:!show]; 110 [denyButton_ setHidden:!show];
110 [exitLabel_ setHidden:show]; 111 [exitLabel_ setHidden:show];
111 } 112 }
112 113
113 // We want this to be a child of a browser window. addChildWindow: 114 // We want this to be a child of a browser window. addChildWindow:
114 // (called from this function) will bring the window on-screen; 115 // (called from this function) will bring the window on-screen;
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 - (void)hideSoon { 302 - (void)hideSoon {
302 hideTimer_.reset( 303 hideTimer_.reset(
303 [[NSTimer scheduledTimerWithTimeInterval:kInitialDelay 304 [[NSTimer scheduledTimerWithTimeInterval:kInitialDelay
304 target:self 305 target:self
305 selector:@selector(hideTimerFired:) 306 selector:@selector(hideTimerFired:)
306 userInfo:nil 307 userInfo:nil
307 repeats:NO] retain]); 308 repeats:NO] retain]);
308 } 309 }
309 310
310 @end 311 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | chrome/browser/ui/extensions/application_launch.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698