| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_UI_COCOA_DEV_TOOLS_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_DEV_TOOLS_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_COCOA_DEV_TOOLS_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_COCOA_DEV_TOOLS_CONTROLLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #import <Foundation/Foundation.h> | 9 #import <Foundation/Foundation.h> |
| 10 | 10 |
| 11 #import "base/mac/cocoa_protocols.h" | 11 #import "base/mac/cocoa_protocols.h" |
| 12 #include "base/memory/scoped_nsobject.h" | 12 #include "base/memory/scoped_nsobject.h" |
| 13 #import "chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h" | |
| 14 | 13 |
| 15 @class NSSplitView; | 14 @class NSSplitView; |
| 16 @class NSView; | 15 @class NSView; |
| 17 | 16 |
| 18 class Profile; | 17 class Profile; |
| 19 class TabContents; | 18 |
| 19 namespace content { |
| 20 class WebContents; |
| 21 } |
| 20 | 22 |
| 21 // A class that handles updates of the devTools view within a browser window. | 23 // A class that handles updates of the devTools view within a browser window. |
| 22 // It swaps in the relevant devTools contents for a given TabContents or removes | 24 // It swaps in the relevant devTools contents for a given WebContents or removes |
| 23 // the view, if there's no devTools contents to show. | 25 // the view, if there's no devTools contents to show. |
| 24 @interface DevToolsController : NSObject<NSSplitViewDelegate> { | 26 @interface DevToolsController : NSObject<NSSplitViewDelegate> { |
| 25 @private | 27 @private |
| 26 // A view hosting docked devTools contents. | 28 // A view hosting docked devTools contents. |
| 27 scoped_nsobject<NSSplitView> splitView_; | 29 scoped_nsobject<NSSplitView> splitView_; |
| 28 | 30 |
| 29 BOOL dockToRight_; | 31 BOOL dockToRight_; |
| 30 | |
| 31 // Manages currently displayed devTools contents. | |
| 32 scoped_nsobject<TabContentsController> contentsController_; | |
| 33 } | 32 } |
| 34 | 33 |
| 35 - (id)initWithDelegate:(id<TabContentsControllerDelegate>)delegate; | 34 - (id)init; |
| 36 | 35 |
| 37 // This controller's view. | 36 // This controller's view. |
| 38 - (NSView*)view; | 37 - (NSView*)view; |
| 39 | 38 |
| 40 // The compiler seems to have trouble handling a function named "view" that | 39 // The compiler seems to have trouble handling a function named "view" that |
| 41 // returns an NSSplitView, so provide a differently-named method. | 40 // returns an NSSplitView, so provide a differently-named method. |
| 42 - (NSSplitView*)splitView; | 41 - (NSSplitView*)splitView; |
| 43 | 42 |
| 44 // Depending on |contents|'s state, decides whether the docked web inspector | 43 // Depending on |contents|'s state, decides whether the docked web inspector |
| 45 // should be shown or hidden and adjusts its height (|delegate_| handles | 44 // should be shown or hidden and adjusts its height (|delegate_| handles |
| 46 // the actual resize). | 45 // the actual resize). |
| 47 - (void)updateDevToolsForWebContents:(content::WebContents*)contents | 46 - (void)updateDevToolsForWebContents:(content::WebContents*)contents |
| 48 withProfile:(Profile*)profile; | 47 withProfile:(Profile*)profile; |
| 49 | 48 |
| 50 // Specifies whether devtools should dock to right. | 49 // Specifies whether devtools should dock to right. |
| 51 - (void)setDockToRight:(BOOL)dock_to_right | 50 - (void)setDockToRight:(BOOL)dock_to_right |
| 52 withProfile:(Profile*)profile; | 51 withProfile:(Profile*)profile; |
| 53 | |
| 54 // Call when the devTools view is properly sized and the render widget host view | |
| 55 // should be put into the view hierarchy. | |
| 56 - (void)ensureContentsVisible; | |
| 57 | |
| 58 @end | 52 @end |
| 59 | 53 |
| 60 #endif // CHROME_BROWSER_UI_COCOA_DEV_TOOLS_CONTROLLER_H_ | 54 #endif // CHROME_BROWSER_UI_COCOA_DEV_TOOLS_CONTROLLER_H_ |
| OLD | NEW |