OLD | NEW |
(Empty) | |
| 1 // Copyright 2012 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 IOS_CHROME_BROWSER_UI_NATIVE_CONTENT_CONTROLLER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_NATIVE_CONTENT_CONTROLLER_H_ |
| 7 |
| 8 #import <Foundation/Foundation.h> |
| 9 |
| 10 #import "ios/web/public/web_state/crw_native_content.h" |
| 11 #include "url/gurl.h" |
| 12 |
| 13 @class UIView; |
| 14 |
| 15 // Abstract base class for controllers that implement the behavior for native |
| 16 // views that are presented inside the web content area. Automatically removes |
| 17 // |view| from the view hierarchy when it is destroyed. Subclasses are |
| 18 // responsible for setting the view (usually through loading a nib) and the |
| 19 // page title. |
| 20 @interface NativeContentController : NSObject<CRWNativeContent> { |
| 21 @protected |
| 22 UIView* _view; // Top-level view. |
| 23 NSString* _title; |
| 24 GURL _url; |
| 25 } |
| 26 |
| 27 @property(nonatomic, retain) IBOutlet UIView* view; |
| 28 @property(nonatomic, copy) NSString* title; |
| 29 @property(nonatomic, readonly, assign) const GURL& url; |
| 30 |
| 31 // Initializer that attempts to load the nib specified in |nibName| for |
| 32 // |url|, which may be nil. |
| 33 - (instancetype)initWithNibName:(NSString*)nibName url:(const GURL&)url; |
| 34 |
| 35 // Initializer with the |url| to be loaded. |
| 36 - (instancetype)initWithURL:(const GURL&)url; |
| 37 |
| 38 // Called when memory is low and this is not the foreground tab. Release |
| 39 // anything (such as views) that can be easily re-created to free up RAM. |
| 40 // Subclasses that override this method should always call |
| 41 // [super handleLowMemory]. |
| 42 - (void)handleLowMemory; |
| 43 |
| 44 @end |
| 45 |
| 46 #endif // IOS_CHROME_BROWSER_UI_NATIVE_CONTENT_CONTROLLER_H_ |
OLD | NEW |