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

Unified Diff: ios/web/public/web_state/web_state_delegate.h

Issue 1851003003: [ios] Added web// public API to let embedder observe loading progress. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed compilation Created 4 years, 8 months 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/web/public/web_state/web_state.h ('k') | ios/web/public/web_state/web_state_delegate_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/public/web_state/web_state_delegate.h
diff --git a/ios/web/public/web_state/web_state_delegate.h b/ios/web/public/web_state/web_state_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..f611da3cb94169e498ba4cc6bc55630e93194c03
--- /dev/null
+++ b/ios/web/public/web_state/web_state_delegate.h
@@ -0,0 +1,50 @@
+// Copyright 2016 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_WEB_PUBLIC_WEB_STATE_WEB_STATE_DELEGATE_H_
+#define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_DELEGATE_H_
+
+#include <set>
+
+#include "base/callback.h"
+
+namespace net {
+class SSLInfo;
+}
+
+namespace web {
+
+struct SSLStatus;
+class WebState;
+
+// Objects implement this interface to get notified about changes in the
+// WebState and to provide necessary functionality.
+class WebStateDelegate {
+ public:
+ WebStateDelegate();
+
+ // Notifies the delegate that the page has made some progress loading.
+ // |progress| is a value between 0.0 (nothing loaded) to 1.0 (page fully
+ // loaded).
+ virtual void LoadProgressChanged(WebState* source, double progress);
+
+ protected:
+ virtual ~WebStateDelegate();
+
+ private:
+ friend class WebStateImpl;
+
+ // Called when |this| becomes the WebStateDelegate for |source|.
+ void Attach(WebState* source);
+
+ // Called when |this| is no longer the WebStateDelegate for |source|.
+ void Detach(WebState* source);
+
+ // The WebStates for which |this| is currently a delegate.
+ std::set<WebState*> attached_states_;
+};
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_DELEGATE_H_
« no previous file with comments | « ios/web/public/web_state/web_state.h ('k') | ios/web/public/web_state/web_state_delegate_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698