| 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 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| 7 | 7 |
| 8 // A class acting as the Objective-C controller for the Browser | 8 // A class acting as the Objective-C controller for the Browser |
| 9 // object. Handles interactions between Cocoa and the cross-platform | 9 // object. Handles interactions between Cocoa and the cross-platform |
| 10 // code. Each window has a single toolbar and, by virtue of being a | 10 // code. Each window has a single toolbar and, by virtue of being a |
| 11 // TabWindowController, a tab strip along the top. | 11 // TabWindowController, a tab strip along the top. |
| 12 | 12 |
| 13 #import <Cocoa/Cocoa.h> | 13 #import <Cocoa/Cocoa.h> |
| 14 | 14 |
| 15 #include "base/mac/scoped_nsobject.h" | 15 #include "base/mac/scoped_nsobject.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 17 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
| 18 #include "chrome/browser/translate/chrome_translate_client.h" | 18 #include "chrome/browser/translate/chrome_translate_client.h" |
| 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" | 19 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" |
| 20 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" | 20 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" |
| 21 #import "chrome/browser/ui/cocoa/browser_window_fullscreen_transition.h" |
| 21 #import "chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller.h" | 22 #import "chrome/browser/ui/cocoa/exclusive_access_bubble_window_controller.h" |
| 22 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 23 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 23 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" | 24 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
| 24 #import "chrome/browser/ui/cocoa/themed_window.h" | 25 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 25 #import "chrome/browser/ui/cocoa/url_drop_target.h" | 26 #import "chrome/browser/ui/cocoa/url_drop_target.h" |
| 26 #import "chrome/browser/ui/cocoa/view_resizer.h" | 27 #import "chrome/browser/ui/cocoa/view_resizer.h" |
| 27 #include "chrome/browser/ui/tabs/tab_utils.h" | 28 #include "chrome/browser/ui/tabs/tab_utils.h" |
| 28 #include "components/translate/core/common/translate_errors.h" | 29 #include "components/translate/core/common/translate_errors.h" |
| 29 #include "ui/base/accelerators/accelerator_manager.h" | 30 #include "ui/base/accelerators/accelerator_manager.h" |
| 30 #include "ui/gfx/geometry/rect.h" | 31 #include "ui/gfx/geometry/rect.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 58 class WebContents; | 59 class WebContents; |
| 59 } | 60 } |
| 60 | 61 |
| 61 namespace extensions { | 62 namespace extensions { |
| 62 class Command; | 63 class Command; |
| 63 } | 64 } |
| 64 | 65 |
| 65 @interface BrowserWindowController | 66 @interface BrowserWindowController |
| 66 : TabWindowController<BookmarkBarControllerDelegate, | 67 : TabWindowController<BookmarkBarControllerDelegate, |
| 67 ViewResizer, | 68 ViewResizer, |
| 68 TabStripControllerDelegate> { | 69 TabStripControllerDelegate, |
| 70 BrowserWindowFullscreenTransitionDelegate> { |
| 69 @private | 71 @private |
| 70 // The ordering of these members is important as it determines the order in | 72 // The ordering of these members is important as it determines the order in |
| 71 // which they are destroyed. |browser_| needs to be destroyed last as most of | 73 // which they are destroyed. |browser_| needs to be destroyed last as most of |
| 72 // the other objects hold weak references to it or things it owns | 74 // the other objects hold weak references to it or things it owns |
| 73 // (tab/toolbar/bookmark models, profiles, etc). | 75 // (tab/toolbar/bookmark models, profiles, etc). |
| 74 scoped_ptr<Browser> browser_; | 76 scoped_ptr<Browser> browser_; |
| 75 NSWindow* savedRegularWindow_; | 77 NSWindow* savedRegularWindow_; |
| 76 scoped_ptr<BrowserWindowCocoa> windowShim_; | 78 scoped_ptr<BrowserWindowCocoa> windowShim_; |
| 77 base::scoped_nsobject<ToolbarController> toolbarController_; | 79 base::scoped_nsobject<ToolbarController> toolbarController_; |
| 78 base::scoped_nsobject<TabStripController> tabStripController_; | 80 base::scoped_nsobject<TabStripController> tabStripController_; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 BOOL enteringAppKitFullscreenOnPrimaryScreen_; | 159 BOOL enteringAppKitFullscreenOnPrimaryScreen_; |
| 158 | 160 |
| 159 // This flag is set to true when |customWindowsToEnterFullScreenForWindow:| | 161 // This flag is set to true when |customWindowsToEnterFullScreenForWindow:| |
| 160 // and |customWindowsToExitFullScreenForWindow:| are called and did not | 162 // and |customWindowsToExitFullScreenForWindow:| are called and did not |
| 161 // return nil. | 163 // return nil. |
| 162 BOOL isUsingCustomAnimation_; | 164 BOOL isUsingCustomAnimation_; |
| 163 | 165 |
| 164 // True if the toolbar needs to be shown in fullscreen. | 166 // True if the toolbar needs to be shown in fullscreen. |
| 165 BOOL shouldShowFullscreenToolbar_; | 167 BOOL shouldShowFullscreenToolbar_; |
| 166 | 168 |
| 169 // True if AppKit has finished exiting fullscreen before the exit animation |
| 170 // is completed. This flag is used to ensure that |windowDidExitFullscreen| |
| 171 // is called after the exit fullscreen animation is complete. |
| 172 BOOL appKitDidExitFullscreen_; |
| 173 |
| 167 // The size of the original (non-fullscreen) window. This is saved just | 174 // The size of the original (non-fullscreen) window. This is saved just |
| 168 // before entering fullscreen mode and is only valid when |-isFullscreen| | 175 // before entering fullscreen mode and is only valid when |-isFullscreen| |
| 169 // returns YES. | 176 // returns YES. |
| 170 NSRect savedRegularWindowFrame_; | 177 NSRect savedRegularWindowFrame_; |
| 171 | 178 |
| 172 // The proportion of the floating bar which is shown (in presentation mode). | 179 // The proportion of the floating bar which is shown (in presentation mode). |
| 173 CGFloat floatingBarShownFraction_; | 180 CGFloat floatingBarShownFraction_; |
| 174 | 181 |
| 175 // Various UI elements/events may want to ensure that the floating bar is | 182 // Various UI elements/events may want to ensure that the floating bar is |
| 176 // visible (in presentation mode), e.g., because of where the mouse is or | 183 // visible (in presentation mode), e.g., because of where the mouse is or |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 639 // Returns the active tab contents controller's |blockFullscreenResize_| flag. | 646 // Returns the active tab contents controller's |blockFullscreenResize_| flag. |
| 640 - (BOOL)isActiveTabContentsControllerResizeBlocked; | 647 - (BOOL)isActiveTabContentsControllerResizeBlocked; |
| 641 | 648 |
| 642 // Returns the presentation mode controller. | 649 // Returns the presentation mode controller. |
| 643 - (PresentationModeController*)presentationModeController; | 650 - (PresentationModeController*)presentationModeController; |
| 644 | 651 |
| 645 @end // @interface BrowserWindowController (TestingAPI) | 652 @end // @interface BrowserWindowController (TestingAPI) |
| 646 | 653 |
| 647 | 654 |
| 648 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ | 655 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ |
| OLD | NEW |