OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_UI_COCOA_SIDEBAR_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_SIDEBAR_CONTROLLER_H_ |
| 7 |
| 8 #import "base/mac/cocoa_protocols.h" |
| 9 #include "base/mac/scoped_nsobject.h" |
| 10 #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" |
| 11 |
| 12 @class NSSplitView; |
| 13 @class NSView; |
| 14 namespace content { |
| 15 class WebContents; |
| 16 } |
| 17 |
| 18 // A class that handles updates of the sidebar view within a browser window. |
| 19 // It swaps in the relevant sidebar contents for a given TabContents or removes |
| 20 // the vew, if there's no sidebar contents to show. |
| 21 @interface SidebarController : NSObject<NSSplitViewDelegate> { |
| 22 @private |
| 23 // A view hosting sidebar contents. |
| 24 base::scoped_nsobject<NSSplitView> splitView_; |
| 25 |
| 26 // Manages currently displayed sidebar contents. |
| 27 base::scoped_nsobject<TabContentsController> contentsController_; |
| 28 } |
| 29 |
| 30 - (id)initWithParentViewController:(id)parentController |
| 31 andContentsController:(id)contentsController; |
| 32 |
| 33 // This controller's view. |
| 34 - (NSSplitView*)view; |
| 35 |
| 36 // Depending on |contents|'s state, decides whether the sidebar |
| 37 // should be shown or hidden and adjusts its width (|delegate_| handles |
| 38 // the actual resize). |
| 39 - (void)updateSidebarForTabContents:(content::WebContents*)contents; |
| 40 |
| 41 // Call when the sidebar view is properly sized and the render widget host view |
| 42 // should be put into the view hierarchy. |
| 43 - (void)ensureContentsVisible; |
| 44 |
| 45 @end |
| 46 |
| 47 #endif // CHROME_BROWSER_UI_COCOA_SIDEBAR_CONTROLLER_H_ |
OLD | NEW |