Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / ios / web / web_state / ui / crw_web_controller_container_view.h
blobac7ffade20ccfddb5e039c419a3ea7f9cac2fb39
1 // Copyright 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.
5 #ifndef IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_CONTAINER_VIEW_H_
6 #define IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_CONTAINER_VIEW_H_
8 #import <UIKit/UIKit.h>
10 #include "ios/web/public/web_state/ui/crw_content_view.h"
12 @class CRWWebViewContentView;
13 @class CRWWebViewProxyImpl;
14 @protocol CRWNativeContent;
16 // Container view class that manages the display of content within
17 // CRWWebController.
18 @interface CRWWebControllerContainerView : UIView
20 #pragma mark Content Views
21 // The web view content view being displayed.
22 @property(nonatomic, retain, readonly)
23 CRWWebViewContentView* webViewContentView;
24 // The native controller whose content is being displayed.
25 @property(nonatomic, retain, readonly) id<CRWNativeContent> nativeController;
26 // The currently displayed transient content view.
27 @property(nonatomic, retain, readonly) CRWContentView* transientContentView;
29 // Designated initializer. |proxy|'s content view will be updated as different
30 // content is added to the container.
31 - (instancetype)initWithContentViewProxy:(CRWWebViewProxyImpl*)proxy
32 NS_DESIGNATED_INITIALIZER;
34 // CRWWebControllerContainerView should be initialized via
35 // |-initWithContentViewProxy:|.
36 - (instancetype)initWithCoder:(NSCoder*)decoder NS_UNAVAILABLE;
37 - (instancetype)initWithFrame:(CGRect)frame NS_UNAVAILABLE;
39 // Returns YES if the container view is currently displaying content.
40 - (BOOL)isViewAlive;
42 // Removes all subviews and resets state to default.
43 - (void)resetContent;
45 // Replaces the currently displayed content with |webViewContentView|.
46 - (void)displayWebViewContentView:(CRWWebViewContentView*)webViewContentView;
48 // Replaces the currently displayed content with |nativeController|'s view.
49 - (void)displayNativeContent:(id<CRWNativeContent>)nativeController;
51 // Adds |transientContentView| as a subview above previously displayed content.
52 - (void)displayTransientContent:(CRWContentView*)transientContentView;
54 // Removes the transient content view, if one is displayed.
55 - (void)clearTransientContentView;
57 #pragma mark Toolbars
59 // |toolbar| will be resized to the container width, bottom-aligned, and added
60 // as the topmost subview.
61 - (void)addToolbar:(UIView*)toolbar;
63 // Adds each toolbar in |toolbars|.
64 - (void)addToolbars:(NSArray*)toolbars;
66 // Removes |toolbar| as a subview.
67 - (void)removeToolbar:(UIView*)toolbar;
69 // Removes all toolbars added via |-addToolbar:|.
70 - (void)removeAllToolbars;
72 @end
74 #endif // IOS_WEB_WEB_STATE_UI_CRW_WEB_CONTROLLER_CONTAINER_VIEW_H_