Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(344)

Unified Diff: ios/chrome/browser/ui/omnibox/preload_provider.h

Issue 2589803002: Upstream Chrome on iOS source code [6/11]. (Closed)
Patch Set: Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/omnibox/preload_provider.h
diff --git a/ios/chrome/browser/ui/omnibox/preload_provider.h b/ios/chrome/browser/ui/omnibox/preload_provider.h
new file mode 100644
index 0000000000000000000000000000000000000000..9cf48920aca361a6dbb89c912d82bc4838b1e86a
--- /dev/null
+++ b/ios/chrome/browser/ui/omnibox/preload_provider.h
@@ -0,0 +1,47 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef IOS_CHROME_BROWSER_UI_OMNIBOX_PRELOAD_PROVIDER_H_
+#define IOS_CHROME_BROWSER_UI_OMNIBOX_PRELOAD_PROVIDER_H_
+
+#import <UIKit/UIKit.h>
+
+#include "ui/base/page_transition_types.h"
+#include "url/gurl.h"
+
+namespace web {
+struct Referrer;
+}
+
+// Protocol for an object that provides preloading capabilities.
+@protocol PreloadProvider
+
+// Prerenders the given |url| with the given |transition|. Normally, prerender
+// requests are fulfilled after a short delay, to prevent unnecessary prerenders
+// while the user is typing. If |immediately| is YES, this method starts
+// prerendering immediately, with no delay. |immediately| should be set to YES
+// only when there is a very high confidence that the user will navigate to the
+// given |url|.
+//
+// If there is already an existing request for |url|, this method does nothing
+// and does not reset the delay timer. If there is an existing request for a
+// different URL, this method cancels that request and queues this request
+// instead.
+- (void)prerenderURL:(const GURL&)url
+ referrer:(const web::Referrer&)referrer
+ transition:(ui::PageTransition)transition
+ immediately:(BOOL)immediately;
+
+// Cancels any outstanding prerender requests and destroys any prerendered Tabs.
+- (void)cancelPrerender;
+
+// Prefetches the |url|.
+- (void)prefetchURL:(const GURL&)url transition:(ui::PageTransition)transition;
+
+// Cancels any outstanding prefetch requests.
+- (void)cancelPrefetch;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_UI_OMNIBOX_PRELOAD_PROVIDER_H_

Powered by Google App Engine
This is Rietveld 408576698