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_STATIC_CONTENT_STATIC_HTML_NATIVE_CONTENT_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_STATIC_CONTENT_STATIC_HTML_NATIVE_CONTENT_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #import "ios/web/public/web_state/ui/crw_native_content.h" |
| 11 #include "ui/base/page_transition_types.h" |
| 12 |
| 13 class GURL; |
| 14 @class StaticHtmlViewController; |
| 15 @protocol UrlLoader; |
| 16 |
| 17 namespace web { |
| 18 class BrowserState; |
| 19 struct Referrer; |
| 20 } |
| 21 |
| 22 @class OverscrollActionsController; |
| 23 |
| 24 // A |CRWNativeContent| that displays html pages either located in the |
| 25 // application bundle, or obtained by a |HtmlGenerator|. |
| 26 @interface StaticHtmlNativeContent : NSObject<CRWNativeContent> |
| 27 |
| 28 - (instancetype)initWithLoader:(id<UrlLoader>)loader |
| 29 staticHTMLViewController:(StaticHtmlViewController*)HTMLViewController |
| 30 URL:(const GURL&)URL NS_DESIGNATED_INITIALIZER; |
| 31 |
| 32 // Convenience initializer. Creates a StaticHtmlNativeContent that displays |
| 33 // the resource at |resourcePath|. |
| 34 // |resourcePath| is the location of the static page to display, relative to the |
| 35 // root of the application bundle. |
| 36 // |loader| is the loader to use to follow navigation. Cannot be nil. |
| 37 // |browserState| is the user browser state and must not be null. |
| 38 // |URL| is the url of the page. |
| 39 - (instancetype)initWithResourcePathResource:(NSString*)resourcePath |
| 40 loader:(id<UrlLoader>)loader |
| 41 browserState:(web::BrowserState*)browserState |
| 42 url:(const GURL&)URL; |
| 43 |
| 44 - (instancetype)init NS_UNAVAILABLE; |
| 45 |
| 46 // Loads a new url. |
| 47 - (void)loadURL:(const GURL&)URL |
| 48 referrer:(const web::Referrer&)referrer |
| 49 transition:(ui::PageTransition)transition |
| 50 rendererInitiated:(BOOL)rendererInitiated; |
| 51 |
| 52 // The scrollview of the native view. |
| 53 - (UIScrollView*)scrollView; |
| 54 |
| 55 // The overscroll actions controller of the native content. |
| 56 // Setting this value to non-nil will enable Overscroll Actions. |
| 57 // Invalidated when |close| is called on this object. |
| 58 @property(nonatomic, assign) |
| 59 OverscrollActionsController* overscrollActionsController; |
| 60 |
| 61 @end |
| 62 |
| 63 #endif // IOS_CHROME_BROWSER_UI_STATIC_CONTENT_STATIC_HTML_NATIVE_CONTENT_H_ |
OLD | NEW |