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

Unified Diff: ios/chrome/browser/web/auto_reload_controller.h

Issue 2580333003: Upstream Chrome on iOS source code [10/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
« no previous file with comments | « ios/chrome/browser/web/auto_reload_bridge.mm ('k') | ios/chrome/browser/web/auto_reload_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/web/auto_reload_controller.h
diff --git a/ios/chrome/browser/web/auto_reload_controller.h b/ios/chrome/browser/web/auto_reload_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..49d73cc52a6a50c8f8b644674abd936872c3ab5f
--- /dev/null
+++ b/ios/chrome/browser/web/auto_reload_controller.h
@@ -0,0 +1,49 @@
+// Copyright 2014 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_WEB_AUTO_RELOAD_CONTROLLER_H_
+#define IOS_CHROME_BROWSER_WEB_AUTO_RELOAD_CONTROLLER_H_
+
+#include <Foundation/Foundation.h>
+
+#include "url/gurl.h"
+
+// AutoReloadDelegate is the interface by which AutoReloadController affects the
+// outside world. Tests can use a mock object implementing this protocol;
+// normally, this is provided by AutoReloadBridge.
+@protocol AutoReloadDelegate
+
+// When called, this method should reload the tab being tracked (see the class
+// comment on AutoReloadController below).
+- (void)reload;
+
+@end
+
+// AutoReloadController implements the auto-reload logic. An
+// AutoReloadController instance receives state change notifications from an
+// AutoReloadBridge and calls back to its AutoReloadDelegate (in practice the
+// same object as the AutoReloadBridge) to issue reload requests. Conceptually,
+// an AutoReloadController tracks the state of a single tab.
+@interface AutoReloadController : NSObject
+
+// Initialize this object with a supplied delegate and initial online status.
+- (instancetype)initWithDelegate:(id<AutoReloadDelegate>)delegate
+ onlineStatus:(BOOL)onlineStatus;
+
+// This method notifies this object that a page load started for |url|.
+- (void)loadStartedForURL:(const GURL&)url;
+
+// This method notifies this object that a page load finished for |url|.
+- (void)loadFinishedForURL:(const GURL&)url wasPost:(BOOL)wasPost;
+
+// This method notifies this object that a page load failed for |url|.
+- (void)loadFailedForURL:(const GURL&)url wasPost:(BOOL)wasPost;
+
+// This method notifies this object that the device's network state changed to
+// |online|.
+- (void)networkStateChangedToOnline:(BOOL)online;
+
+@end
+
+#endif // IOS_CHROME_BROWSER_WEB_AUTO_RELOAD_CONTROLLER_H_
« no previous file with comments | « ios/chrome/browser/web/auto_reload_bridge.mm ('k') | ios/chrome/browser/web/auto_reload_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698