OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_BRIDGE_H_ | 5 #ifndef IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_BRIDGE_H_ |
6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_BRIDGE_H_ | 6 #define IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_BRIDGE_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 // Invoked by WebStateObserverBridge::FaviconUrlUpdated. | 64 // Invoked by WebStateObserverBridge::FaviconUrlUpdated. |
65 - (void)webState:(web::WebState*)webState | 65 - (void)webState:(web::WebState*)webState |
66 didUpdateFaviconURLCandidates: | 66 didUpdateFaviconURLCandidates: |
67 (const std::vector<web::FaviconURL>&)candidates; | 67 (const std::vector<web::FaviconURL>&)candidates; |
68 | 68 |
69 // Note: after |webStateDestroyed:| is invoked, the WebState being observed | 69 // Note: after |webStateDestroyed:| is invoked, the WebState being observed |
70 // is no longer valid. | 70 // is no longer valid. |
71 - (void)webStateDestroyed:(web::WebState*)webState; | 71 - (void)webStateDestroyed:(web::WebState*)webState; |
72 | 72 |
| 73 // Invoked by WebStateObserverBridge::DidStopLoading. |
| 74 - (void)webStateDidStopLoading:(web::WebState*)webState; |
| 75 |
| 76 // Invoked by WebStateObserverBridge::DidStartLoading. |
| 77 - (void)webStateDidStartLoading:(web::WebState*)webState; |
| 78 |
73 @end | 79 @end |
74 | 80 |
75 namespace web { | 81 namespace web { |
76 | 82 |
77 class WebState; | 83 class WebState; |
78 | 84 |
79 // Bridge to use an id<CRWWebStateObserver> as a web::WebStateObserver. | 85 // Bridge to use an id<CRWWebStateObserver> as a web::WebStateObserver. |
80 // Will be added/removed as an observer of the underlying WebState during | 86 // Will be added/removed as an observer of the underlying WebState during |
81 // construction/destruction. Instances should be owned by instances of the | 87 // construction/destruction. Instances should be owned by instances of the |
82 // class they're bridging. | 88 // class they're bridging. |
(...skipping 18 matching lines...) Expand all Loading... |
101 const std::string& field_name, | 107 const std::string& field_name, |
102 const std::string& type, | 108 const std::string& type, |
103 const std::string& value, | 109 const std::string& value, |
104 int key_code, | 110 int key_code, |
105 bool input_missing) override; | 111 bool input_missing) override; |
106 void AutocompleteRequested(const GURL& source_url, | 112 void AutocompleteRequested(const GURL& source_url, |
107 const std::string& form_name, | 113 const std::string& form_name, |
108 bool user_initiated) override; | 114 bool user_initiated) override; |
109 void FaviconUrlUpdated(const std::vector<FaviconURL>& candidates) override; | 115 void FaviconUrlUpdated(const std::vector<FaviconURL>& candidates) override; |
110 void WebStateDestroyed() override; | 116 void WebStateDestroyed() override; |
| 117 void DidStartLoading() override; |
| 118 void DidStopLoading() override; |
111 | 119 |
112 private: | 120 private: |
113 base::WeakNSProtocol<id<CRWWebStateObserver>> observer_; | 121 base::WeakNSProtocol<id<CRWWebStateObserver>> observer_; |
114 DISALLOW_COPY_AND_ASSIGN(WebStateObserverBridge); | 122 DISALLOW_COPY_AND_ASSIGN(WebStateObserverBridge); |
115 }; | 123 }; |
116 | 124 |
117 } // namespace web | 125 } // namespace web |
118 | 126 |
119 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_BRIDGE_H_ | 127 #endif // IOS_WEB_PUBLIC_WEB_STATE_WEB_STATE_OBSERVER_BRIDGE_H_ |
OLD | NEW |