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

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

Issue 7484029: Implemented kiosk mode for Mac. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebase from trunk 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) 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 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" 5 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h"
9 #import "base/mac/mac_util.h" 10 #import "base/mac/mac_util.h"
10 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 11 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
12 #include "chrome/common/chrome_switches.h"
11 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" 13 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
12 14
13 NSString* const kWillEnterFullscreenNotification = 15 NSString* const kWillEnterFullscreenNotification =
14 @"WillEnterFullscreenNotification"; 16 @"WillEnterFullscreenNotification";
15 NSString* const kWillLeaveFullscreenNotification = 17 NSString* const kWillLeaveFullscreenNotification =
16 @"WillLeaveFullscreenNotification"; 18 @"WillLeaveFullscreenNotification";
17 19
18 namespace { 20 namespace {
19 // The activation zone for the main menu is 4 pixels high; if we make it any 21 // The activation zone for the main menu is 4 pixels high; if we make it any
20 // smaller, then the menu can be made to appear without the bar sliding down. 22 // smaller, then the menu can be made to appear without the bar sliding down.
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 [browserController_ lockBarVisibilityForOwner:self 280 [browserController_ lockBarVisibilityForOwner:self
279 withAnimation:NO 281 withAnimation:NO
280 delay:NO]; 282 delay:NO];
281 [self setupTrackingArea]; 283 [self setupTrackingArea];
282 } 284 }
283 285
284 - (void)ensureOverlayShownWithAnimation:(BOOL)animate delay:(BOOL)delay { 286 - (void)ensureOverlayShownWithAnimation:(BOOL)animate delay:(BOOL)delay {
285 if (!inPresentationMode_) 287 if (!inPresentationMode_)
286 return; 288 return;
287 289
290 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode))
291 return;
292
288 if (animate) { 293 if (animate) {
289 if (delay) { 294 if (delay) {
290 [self startShowTimer]; 295 [self startShowTimer];
291 } else { 296 } else {
292 [self cancelAllTimers]; 297 [self cancelAllTimers];
293 [self changeOverlayToFraction:1 withAnimation:YES]; 298 [self changeOverlayToFraction:1 withAnimation:YES];
294 } 299 }
295 } else { 300 } else {
296 DCHECK(!delay); 301 DCHECK(!delay);
297 [self cancelAllTimers]; 302 [self cancelAllTimers];
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 - (void)hideActiveWindowUI { 645 - (void)hideActiveWindowUI {
641 if (systemFullscreenMode_ != base::mac::kFullScreenModeNormal) { 646 if (systemFullscreenMode_ != base::mac::kFullScreenModeNormal) {
642 base::mac::ReleaseFullScreen(systemFullscreenMode_); 647 base::mac::ReleaseFullScreen(systemFullscreenMode_);
643 systemFullscreenMode_ = base::mac::kFullScreenModeNormal; 648 systemFullscreenMode_ = base::mac::kFullScreenModeNormal;
644 } 649 }
645 650
646 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 651 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956
647 } 652 }
648 653
649 @end 654 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/browser_window_controller_private.mm ('k') | chrome/browser/ui/fullscreen_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698