| OLD | NEW |
| 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 "chrome/browser/ui/cocoa/browser_window_controller_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #import "base/memory/scoped_nsobject.h" | 10 #import "base/memory/scoped_nsobject.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #import "chrome/browser/ui/cocoa/fullscreen_window.h" | 24 #import "chrome/browser/ui/cocoa/fullscreen_window.h" |
| 25 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" | 25 #import "chrome/browser/ui/cocoa/infobars/infobar_container_controller.h" |
| 26 #import "chrome/browser/ui/cocoa/nsview_additions.h" | 26 #import "chrome/browser/ui/cocoa/nsview_additions.h" |
| 27 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" | 27 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" |
| 28 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" | 28 #import "chrome/browser/ui/cocoa/status_bubble_mac.h" |
| 29 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" | 29 #import "chrome/browser/ui/cocoa/tab_contents/previewable_contents_controller.h" |
| 30 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 30 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 31 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 31 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 32 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 32 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 33 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 33 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 34 #include "chrome/common/chrome_switches.h" |
| 34 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
| 35 #include "content/public/browser/render_widget_host_view.h" | 36 #include "content/public/browser/render_widget_host_view.h" |
| 36 #include "content/public/browser/web_contents.h" | 37 #include "content/public/browser/web_contents.h" |
| 37 #include "content/public/browser/web_contents_view.h" | 38 #include "content/public/browser/web_contents_view.h" |
| 38 #import "ui/base/cocoa/focus_tracker.h" | 39 #import "ui/base/cocoa/focus_tracker.h" |
| 39 #include "ui/base/ui_base_types.h" | 40 #include "ui/base/ui_base_types.h" |
| 40 | 41 |
| 41 using content::RenderWidgetHostView; | 42 using content::RenderWidgetHostView; |
| 42 using content::WebContents; | 43 using content::WebContents; |
| 43 | 44 |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 [self enableBarVisibilityUpdates]; | 676 [self enableBarVisibilityUpdates]; |
| 676 } | 677 } |
| 677 | 678 |
| 678 - (void)setPresentationModeInternal:(BOOL)presentationMode | 679 - (void)setPresentationModeInternal:(BOOL)presentationMode |
| 679 forceDropdown:(BOOL)forceDropdown { | 680 forceDropdown:(BOOL)forceDropdown { |
| 680 if (presentationMode == [self inPresentationMode]) | 681 if (presentationMode == [self inPresentationMode]) |
| 681 return; | 682 return; |
| 682 | 683 |
| 683 if (presentationMode) { | 684 if (presentationMode) { |
| 684 BOOL fullscreen_for_tab = browser_->IsFullscreenForTabOrPending(); | 685 BOOL fullscreen_for_tab = browser_->IsFullscreenForTabOrPending(); |
| 686 BOOL kiosk_mode = |
| 687 CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); |
| 685 BOOL showDropdown = !fullscreen_for_tab && | 688 BOOL showDropdown = !fullscreen_for_tab && |
| 689 !kiosk_mode && |
| 686 (forceDropdown || [self floatingBarHasFocus]); | 690 (forceDropdown || [self floatingBarHasFocus]); |
| 687 NSView* contentView = [[self window] contentView]; | 691 NSView* contentView = [[self window] contentView]; |
| 688 presentationModeController_.reset( | 692 presentationModeController_.reset( |
| 689 [[PresentationModeController alloc] initWithBrowserController:self]); | 693 [[PresentationModeController alloc] initWithBrowserController:self]); |
| 690 [presentationModeController_ enterPresentationModeForContentView:contentView | 694 [presentationModeController_ enterPresentationModeForContentView:contentView |
| 691 showDropdown:showDropdown]; | 695 showDropdown:showDropdown]; |
| 692 } else { | 696 } else { |
| 693 [presentationModeController_ exitPresentationMode]; | 697 [presentationModeController_ exitPresentationMode]; |
| 694 presentationModeController_.reset(); | 698 presentationModeController_.reset(); |
| 695 } | 699 } |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 914 - (void)disableBarVisibilityUpdates { | 918 - (void)disableBarVisibilityUpdates { |
| 915 // Early escape if there's nothing to do. | 919 // Early escape if there's nothing to do. |
| 916 if (!barVisibilityUpdatesEnabled_) | 920 if (!barVisibilityUpdatesEnabled_) |
| 917 return; | 921 return; |
| 918 | 922 |
| 919 barVisibilityUpdatesEnabled_ = NO; | 923 barVisibilityUpdatesEnabled_ = NO; |
| 920 [presentationModeController_ cancelAnimationAndTimers]; | 924 [presentationModeController_ cancelAnimationAndTimers]; |
| 921 } | 925 } |
| 922 | 926 |
| 923 @end // @implementation BrowserWindowController(Private) | 927 @end // @implementation BrowserWindowController(Private) |
| OLD | NEW |