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

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: Self review 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
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..eac642ba61455fbb1b953dfa7437ebca9b16a863
--- /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 for.
rohitrao (ping after 24h) 2016/04/13 12:01:13 Omit the second "for".
Eugene But (OOO till 7-30) 2016/04/13 15:03:53 Done.
+ std::set<WebState*> attached_states_;
+};
+
+} // namespace web
+
+#endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698