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_URL_LOADER_H_ |
| 6 #define IOS_CHROME_BROWSER_UI_URL_LOADER_H_ |
| 7 |
| 8 #import <UIKit/UIKit.h> |
| 9 |
| 10 #include "base/strings/string16.h" |
| 11 #include "ui/base/page_transition_types.h" |
| 12 |
| 13 class GURL; |
| 14 |
| 15 namespace sessions { |
| 16 struct SessionTab; |
| 17 } |
| 18 |
| 19 namespace web { |
| 20 struct Referrer; |
| 21 } |
| 22 |
| 23 // Describes the intended position for a new tab. |
| 24 enum OpenPosition { |
| 25 kCurrentTab, // Relative to currently selected tab. |
| 26 kLastTab // Always at end of tab model. |
| 27 }; |
| 28 |
| 29 @protocol UrlLoader<NSObject> |
| 30 |
| 31 // Load a new url. |
| 32 - (void)loadURL:(const GURL&)url |
| 33 referrer:(const web::Referrer&)referrer |
| 34 transition:(ui::PageTransition)transition |
| 35 rendererInitiated:(BOOL)rendererInitiated; |
| 36 |
| 37 // Load a new URL on a new page/tab. The |referrer| and |windowName| are |
| 38 // optional. The tab will be placed in the model according to |appendTo|. |
| 39 - (void)webPageOrderedOpen:(const GURL&)url |
| 40 referrer:(const web::Referrer&)referrer |
| 41 windowName:(NSString*)windowName |
| 42 inBackground:(BOOL)inBackground |
| 43 appendTo:(OpenPosition)appendTo; |
| 44 |
| 45 // Load a new URL on a new page/tab. The |referrer| and |windowName| are |
| 46 // optional. The tab will be placed in the model according to |appendTo|. |
| 47 - (void)webPageOrderedOpen:(const GURL&)url |
| 48 referrer:(const web::Referrer&)referrer |
| 49 windowName:(NSString*)windowName |
| 50 inIncognito:(BOOL)inIncognito |
| 51 inBackground:(BOOL)inBackground |
| 52 appendTo:(OpenPosition)appendTo; |
| 53 |
| 54 // Load a tab with the given session. |
| 55 - (void)loadSessionTab:(const sessions::SessionTab*)sessionTab; |
| 56 |
| 57 // Loads the text entered in the location bar as javascript. |
| 58 - (void)loadJavaScriptFromLocationBar:(NSString*)script; |
| 59 |
| 60 @end |
| 61 |
| 62 #endif // IOS_CHROME_BROWSER_UI_URL_LOADER_H_ |
OLD | NEW |