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 BrowserContext; |
| 16 class WebContents; |
| 17 } |
| 18 |
| 19 // A class that handles updates of the sidebar view within a browser window. |
| 20 // It swaps in the relevant sidebar contents for a given TabContents or removes |
| 21 // the vew, if there's no sidebar contents to show. |
| 22 @interface SidebarController : NSObject<NSSplitViewDelegate> { |
| 23 @private |
| 24 // A view hosting sidebar contents. |
| 25 base::scoped_nsobject<NSSplitView> splitView_; |
| 26 |
| 27 // Manages currently displayed sidebar contents. |
| 28 base::scoped_nsobject<TabContentsController> contentsController_; |
| 29 } |
| 30 |
| 31 - (id)initWithParentViewController:(id)parentController |
| 32 andContentsController:(id)contentsController; |
| 33 |
| 34 // This controller's view. |
| 35 - (NSSplitView*)view; |
| 36 |
| 37 // Depending on |contents|'s state, decides whether the sidebar |
| 38 // should be shown or hidden and adjusts its width (|delegate_| handles |
| 39 // the actual resize). |
| 40 - (void)updateSidebarForTabContents:(content::WebContents*)contents |
| 41 withContext:(content::BrowserContext*)context; |
| 42 |
| 43 // Call when the sidebar view is properly sized and the render widget host view |
| 44 // should be put into the view hierarchy. |
| 45 - (void)ensureContentsVisible; |
| 46 |
| 47 @end |
| 48 |
| 49 #endif // CHROME_BROWSER_UI_COCOA_SIDEBAR_CONTROLLER_H_ |
OLD | NEW |