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

Side by Side Diff: ios/web/web_state/web_state_impl.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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_WEB_STATE_WEB_STATE_IMPL_H_ 5 #ifndef IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_
6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ 6 #define IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 23 matching lines...) Expand all
34 } 34 }
35 35
36 namespace web { 36 namespace web {
37 37
38 class BrowserState; 38 class BrowserState;
39 struct Credential; 39 struct Credential;
40 struct FaviconURL; 40 struct FaviconURL;
41 struct LoadCommittedDetails; 41 struct LoadCommittedDetails;
42 class NavigationManager; 42 class NavigationManager;
43 class WebInterstitialImpl; 43 class WebInterstitialImpl;
44 class WebStateDelegate;
44 class WebStateFacadeDelegate; 45 class WebStateFacadeDelegate;
45 class WebStatePolicyDecider; 46 class WebStatePolicyDecider;
46 class WebUIIOS; 47 class WebUIIOS;
47 48
48 // Implementation of WebState. 49 // Implementation of WebState.
49 // Generally mirrors //content's WebContents implementation. 50 // Generally mirrors //content's WebContents implementation.
50 // General notes on expected WebStateImpl ownership patterns: 51 // General notes on expected WebStateImpl ownership patterns:
51 // - Outside of tests, WebStateImpls are created 52 // - Outside of tests, WebStateImpls are created
52 // (a) By @Tab, when creating a new Tab. 53 // (a) By @Tab, when creating a new Tab.
53 // (b) By @SessionWindow, when decoding a saved session. 54 // (b) By @SessionWindow, when decoding a saved session.
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 RequestTrackerImpl* GetRequestTracker(); 210 RequestTrackerImpl* GetRequestTracker();
210 211
211 // Lazily creates (if necessary) and returns |request_group_id_|. 212 // Lazily creates (if necessary) and returns |request_group_id_|.
212 // IMPORTANT: This should not be used for anything other than associating this 213 // IMPORTANT: This should not be used for anything other than associating this
213 // instance to network requests. 214 // instance to network requests.
214 // This function is only intended to be used in web/. 215 // This function is only intended to be used in web/.
215 // TODO(stuartmorgan): Move this method in an implementation file in web/. 216 // TODO(stuartmorgan): Move this method in an implementation file in web/.
216 NSString* GetRequestGroupID(); 217 NSString* GetRequestGroupID();
217 218
218 // WebState: 219 // WebState:
220 WebStateDelegate* GetDelegate() override;
221 void SetDelegate(WebStateDelegate* delegate) override;
219 UIView* GetView() override; 222 UIView* GetView() override;
220 web::WebViewType GetWebViewType() const override; 223 web::WebViewType GetWebViewType() const override;
221 BrowserState* GetBrowserState() const override; 224 BrowserState* GetBrowserState() const override;
222 void OpenURL(const WebState::OpenURLParams& params) override; 225 void OpenURL(const WebState::OpenURLParams& params) override;
223 NavigationManager* GetNavigationManager() override; 226 NavigationManager* GetNavigationManager() override;
224 CRWJSInjectionReceiver* GetJSInjectionReceiver() const override; 227 CRWJSInjectionReceiver* GetJSInjectionReceiver() const override;
225 const std::string& GetContentLanguageHeader() const override; 228 const std::string& GetContentLanguageHeader() const override;
226 const std::string& GetContentsMimeType() const override; 229 const std::string& GetContentsMimeType() const override;
227 bool ContentIsHTML() const override; 230 bool ContentIsHTML() const override;
228 const base::string16& GetTitle() const override; 231 const base::string16& GetTitle() const override;
(...skipping 15 matching lines...) Expand all
244 bool bypass_cache, 247 bool bypass_cache,
245 const ImageDownloadCallback& callback) override; 248 const ImageDownloadCallback& callback) override;
246 base::WeakPtr<WebState> AsWeakPtr() override; 249 base::WeakPtr<WebState> AsWeakPtr() override;
247 250
248 // Adds |interstitial|'s view to the web controller's content view. 251 // Adds |interstitial|'s view to the web controller's content view.
249 void ShowWebInterstitial(WebInterstitialImpl* interstitial); 252 void ShowWebInterstitial(WebInterstitialImpl* interstitial);
250 253
251 // Called to dismiss the currently-displayed transient content view. 254 // Called to dismiss the currently-displayed transient content view.
252 void ClearTransientContentView(); 255 void ClearTransientContentView();
253 256
257 // Notifies the delegate that the load progress was updated.
258 void SendChangeLoadProgress(double progress);
259
254 // NavigationManagerDelegate: 260 // NavigationManagerDelegate:
255 void NavigateToPendingEntry() override; 261 void NavigateToPendingEntry() override;
256 void LoadURLWithParams(const NavigationManager::WebLoadParams&) override; 262 void LoadURLWithParams(const NavigationManager::WebLoadParams&) override;
257 void OnNavigationItemsPruned(size_t pruned_item_count) override; 263 void OnNavigationItemsPruned(size_t pruned_item_count) override;
258 void OnNavigationItemChanged() override; 264 void OnNavigationItemChanged() override;
259 void OnNavigationItemCommitted( 265 void OnNavigationItemCommitted(
260 const LoadCommittedDetails& load_details) override; 266 const LoadCommittedDetails& load_details) override;
261 WebState* GetWebState() override; 267 WebState* GetWebState() override;
262 268
263 protected: 269 protected:
264 void AddObserver(WebStateObserver* observer) override; 270 void AddObserver(WebStateObserver* observer) override;
265 void RemoveObserver(WebStateObserver* observer) override; 271 void RemoveObserver(WebStateObserver* observer) override;
266 void AddPolicyDecider(WebStatePolicyDecider* decider) override; 272 void AddPolicyDecider(WebStatePolicyDecider* decider) override;
267 void RemovePolicyDecider(WebStatePolicyDecider* decider) override; 273 void RemovePolicyDecider(WebStatePolicyDecider* decider) override;
268 274
269 private: 275 private:
276 // Unowned delegate.
277 WebStateDelegate* delegate_;
278
270 // Creates a WebUIIOS object for |url| that is owned by the caller. Returns 279 // Creates a WebUIIOS object for |url| that is owned by the caller. Returns
271 // nullptr if |url| does not correspond to a WebUI page. 280 // nullptr if |url| does not correspond to a WebUI page.
272 WebUIIOS* CreateWebUIIOS(const GURL& url); 281 WebUIIOS* CreateWebUIIOS(const GURL& url);
273 282
274 // Updates the HTTP response headers for the main page using the headers 283 // Updates the HTTP response headers for the main page using the headers
275 // passed to the OnHttpResponseHeadersReceived() function below. 284 // passed to the OnHttpResponseHeadersReceived() function below.
276 // GetHttpResponseHeaders() can be used to get the headers. 285 // GetHttpResponseHeaders() can be used to get the headers.
277 void UpdateHttpResponseHeaders(const GURL& url); 286 void UpdateHttpResponseHeaders(const GURL& url);
278 287
279 // Returns true if |web_controller_| has been set. 288 // Returns true if |web_controller_| has been set.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 // any WeakPtrs to WebStateImpl are invalidated before its member variable's 346 // any WeakPtrs to WebStateImpl are invalidated before its member variable's
338 // destructors are executed, rendering them invalid. 347 // destructors are executed, rendering them invalid.
339 base::WeakPtrFactory<WebState> weak_factory_; 348 base::WeakPtrFactory<WebState> weak_factory_;
340 349
341 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); 350 DISALLOW_COPY_AND_ASSIGN(WebStateImpl);
342 }; 351 };
343 352
344 } // namespace web 353 } // namespace web
345 354
346 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ 355 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698