OLD | NEW |
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 25 matching lines...) Expand all Loading... |
36 } | 36 } |
37 | 37 |
38 namespace web { | 38 namespace web { |
39 | 39 |
40 class BrowserState; | 40 class BrowserState; |
41 struct ContextMenuParams; | 41 struct ContextMenuParams; |
42 struct Credential; | 42 struct Credential; |
43 struct FaviconURL; | 43 struct FaviconURL; |
44 struct LoadCommittedDetails; | 44 struct LoadCommittedDetails; |
45 class NavigationManager; | 45 class NavigationManager; |
46 class ImageDataFetcher; | |
47 class WebInterstitialImpl; | 46 class WebInterstitialImpl; |
48 class WebStateFacadeDelegate; | 47 class WebStateFacadeDelegate; |
49 class WebStatePolicyDecider; | 48 class WebStatePolicyDecider; |
50 class WebUIIOS; | 49 class WebUIIOS; |
51 | 50 |
52 // Implementation of WebState. | 51 // Implementation of WebState. |
53 // Generally mirrors //content's WebContents implementation. | 52 // Generally mirrors //content's WebContents implementation. |
54 // General notes on expected WebStateImpl ownership patterns: | 53 // General notes on expected WebStateImpl ownership patterns: |
55 // - Outside of tests, WebStateImpls are created | 54 // - Outside of tests, WebStateImpls are created |
56 // (a) By @Tab, when creating a new Tab. | 55 // (a) By @Tab, when creating a new Tab. |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 GURL GetCurrentURL(URLVerificationTrustLevel* trust_level) const override; | 219 GURL GetCurrentURL(URLVerificationTrustLevel* trust_level) const override; |
221 void ShowTransientContentView(CRWContentView* content_view) override; | 220 void ShowTransientContentView(CRWContentView* content_view) override; |
222 bool IsShowingWebInterstitial() const override; | 221 bool IsShowingWebInterstitial() const override; |
223 WebInterstitial* GetWebInterstitial() const override; | 222 WebInterstitial* GetWebInterstitial() const override; |
224 void OnPasswordInputShownOnHttp() override; | 223 void OnPasswordInputShownOnHttp() override; |
225 void OnCreditCardInputShownOnHttp() override; | 224 void OnCreditCardInputShownOnHttp() override; |
226 void AddScriptCommandCallback(const ScriptCommandCallback& callback, | 225 void AddScriptCommandCallback(const ScriptCommandCallback& callback, |
227 const std::string& command_prefix) override; | 226 const std::string& command_prefix) override; |
228 void RemoveScriptCommandCallback(const std::string& command_prefix) override; | 227 void RemoveScriptCommandCallback(const std::string& command_prefix) override; |
229 id<CRWWebViewProxy> GetWebViewProxy() const override; | 228 id<CRWWebViewProxy> GetWebViewProxy() const override; |
230 int DownloadImage(const GURL& url, | |
231 bool is_favicon, | |
232 uint32_t max_bitmap_size, | |
233 bool bypass_cache, | |
234 const ImageDownloadCallback& callback) override; | |
235 service_manager::InterfaceRegistry* GetMojoInterfaceRegistry() override; | 229 service_manager::InterfaceRegistry* GetMojoInterfaceRegistry() override; |
236 base::WeakPtr<WebState> AsWeakPtr() override; | 230 base::WeakPtr<WebState> AsWeakPtr() override; |
237 | 231 |
238 // Adds |interstitial|'s view to the web controller's content view. | 232 // Adds |interstitial|'s view to the web controller's content view. |
239 void ShowWebInterstitial(WebInterstitialImpl* interstitial); | 233 void ShowWebInterstitial(WebInterstitialImpl* interstitial); |
240 | 234 |
241 // Called to dismiss the currently-displayed transient content view. | 235 // Called to dismiss the currently-displayed transient content view. |
242 void ClearTransientContentView(); | 236 void ClearTransientContentView(); |
243 | 237 |
244 // Notifies the delegate that the load progress was updated. | 238 // Notifies the delegate that the load progress was updated. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 std::map<std::string, ScriptCommandCallback> script_command_callbacks_; | 342 std::map<std::string, ScriptCommandCallback> script_command_callbacks_; |
349 | 343 |
350 // Member variables should appear before the WeakPtrFactory<> to ensure that | 344 // Member variables should appear before the WeakPtrFactory<> to ensure that |
351 // any WeakPtrs to WebStateImpl are invalidated before its member variable's | 345 // any WeakPtrs to WebStateImpl are invalidated before its member variable's |
352 // destructors are executed, rendering them invalid. | 346 // destructors are executed, rendering them invalid. |
353 base::WeakPtrFactory<WebState> weak_factory_; | 347 base::WeakPtrFactory<WebState> weak_factory_; |
354 | 348 |
355 // Mojo interface registry for this WebState. | 349 // Mojo interface registry for this WebState. |
356 std::unique_ptr<service_manager::InterfaceRegistry> mojo_interface_registry_; | 350 std::unique_ptr<service_manager::InterfaceRegistry> mojo_interface_registry_; |
357 | 351 |
358 // Image Fetcher used to images. | |
359 std::unique_ptr<ImageDataFetcher> image_fetcher_; | |
360 | |
361 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); | 352 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); |
362 }; | 353 }; |
363 | 354 |
364 } // namespace web | 355 } // namespace web |
365 | 356 |
366 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ | 357 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ |
OLD | NEW |