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 26 matching lines...) Expand all Loading... |
37 | 37 |
38 namespace web { | 38 namespace web { |
39 | 39 |
40 class BrowserState; | 40 class BrowserState; |
41 struct ContextMenuParams; | 41 struct ContextMenuParams; |
42 struct FaviconURL; | 42 struct FaviconURL; |
43 struct LoadCommittedDetails; | 43 struct LoadCommittedDetails; |
44 class NavigationManager; | 44 class NavigationManager; |
45 class SessionCertificatePolicyCacheImpl; | 45 class SessionCertificatePolicyCacheImpl; |
46 class WebInterstitialImpl; | 46 class WebInterstitialImpl; |
| 47 class WebStateInterfaceProvider; |
47 class WebStatePolicyDecider; | 48 class WebStatePolicyDecider; |
48 class WebUIIOS; | 49 class WebUIIOS; |
49 | 50 |
50 // Implementation of WebState. | 51 // Implementation of WebState. |
51 // Generally mirrors //content's WebContents implementation. | 52 // Generally mirrors //content's WebContents implementation. |
52 // General notes on expected WebStateImpl ownership patterns: | 53 // General notes on expected WebStateImpl ownership patterns: |
53 // - Outside of tests, WebStateImpls are created | 54 // - Outside of tests, WebStateImpls are created |
54 // (a) By @Tab, when creating a new Tab. | 55 // (a) By @Tab, when creating a new Tab. |
55 // (b) By @SessionWindow, when decoding a saved session. | 56 // (b) By @SessionWindow, when decoding a saved session. |
56 // (c) By the Copy() method, below, used when marshalling a session | 57 // (c) By the Copy() method, below, used when marshalling a session |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 GURL GetCurrentURL(URLVerificationTrustLevel* trust_level) const override; | 204 GURL GetCurrentURL(URLVerificationTrustLevel* trust_level) const override; |
204 void ShowTransientContentView(CRWContentView* content_view) override; | 205 void ShowTransientContentView(CRWContentView* content_view) override; |
205 bool IsShowingWebInterstitial() const override; | 206 bool IsShowingWebInterstitial() const override; |
206 WebInterstitial* GetWebInterstitial() const override; | 207 WebInterstitial* GetWebInterstitial() const override; |
207 void OnPasswordInputShownOnHttp() override; | 208 void OnPasswordInputShownOnHttp() override; |
208 void OnCreditCardInputShownOnHttp() override; | 209 void OnCreditCardInputShownOnHttp() override; |
209 void AddScriptCommandCallback(const ScriptCommandCallback& callback, | 210 void AddScriptCommandCallback(const ScriptCommandCallback& callback, |
210 const std::string& command_prefix) override; | 211 const std::string& command_prefix) override; |
211 void RemoveScriptCommandCallback(const std::string& command_prefix) override; | 212 void RemoveScriptCommandCallback(const std::string& command_prefix) override; |
212 id<CRWWebViewProxy> GetWebViewProxy() const override; | 213 id<CRWWebViewProxy> GetWebViewProxy() const override; |
213 service_manager::InterfaceRegistry* GetMojoInterfaceRegistry() override; | 214 WebStateInterfaceProvider* GetWebStateInterfaceProvider() override; |
214 bool HasOpener() const override; | 215 bool HasOpener() const override; |
215 base::WeakPtr<WebState> AsWeakPtr() override; | 216 base::WeakPtr<WebState> AsWeakPtr() override; |
216 | 217 |
217 // Adds |interstitial|'s view to the web controller's content view. | 218 // Adds |interstitial|'s view to the web controller's content view. |
218 void ShowWebInterstitial(WebInterstitialImpl* interstitial); | 219 void ShowWebInterstitial(WebInterstitialImpl* interstitial); |
219 | 220 |
220 // Called to dismiss the currently-displayed transient content view. | 221 // Called to dismiss the currently-displayed transient content view. |
221 void ClearTransientContentView(); | 222 void ClearTransientContentView(); |
222 | 223 |
223 // Notifies the delegate that the load progress was updated. | 224 // Notifies the delegate that the load progress was updated. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 // Whether this WebState has an opener. See | 345 // Whether this WebState has an opener. See |
345 // WebState::CreateParams::created_with_opener_ for more details. | 346 // WebState::CreateParams::created_with_opener_ for more details. |
346 bool created_with_opener_; | 347 bool created_with_opener_; |
347 | 348 |
348 // Member variables should appear before the WeakPtrFactory<> to ensure that | 349 // Member variables should appear before the WeakPtrFactory<> to ensure that |
349 // any WeakPtrs to WebStateImpl are invalidated before its member variable's | 350 // any WeakPtrs to WebStateImpl are invalidated before its member variable's |
350 // destructors are executed, rendering them invalid. | 351 // destructors are executed, rendering them invalid. |
351 base::WeakPtrFactory<WebState> weak_factory_; | 352 base::WeakPtrFactory<WebState> weak_factory_; |
352 | 353 |
353 // Mojo interface registry for this WebState. | 354 // Mojo interface registry for this WebState. |
354 std::unique_ptr<service_manager::InterfaceRegistry> mojo_interface_registry_; | 355 std::unique_ptr<WebStateInterfaceProvider> web_state_interface_provider_; |
355 | 356 |
356 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); | 357 DISALLOW_COPY_AND_ASSIGN(WebStateImpl); |
357 }; | 358 }; |
358 | 359 |
359 } // namespace web | 360 } // namespace web |
360 | 361 |
361 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ | 362 #endif // IOS_WEB_WEB_STATE_WEB_STATE_IMPL_H_ |
OLD | NEW |