Chromium Code Reviews| 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_ |