OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_TEST_FAKES_TEST_WEB_STATE_H_ | 5 #ifndef IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_STATE_H_ |
6 #define IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_STATE_H_ | 6 #define IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_STATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 const std::string& GetContentsMimeType() const override; | 46 const std::string& GetContentsMimeType() const override; |
47 const std::string& GetContentLanguageHeader() const override; | 47 const std::string& GetContentLanguageHeader() const override; |
48 bool ContentIsHTML() const override; | 48 bool ContentIsHTML() const override; |
49 const base::string16& GetTitle() const override; | 49 const base::string16& GetTitle() const override; |
50 bool IsLoading() const override; | 50 bool IsLoading() const override; |
51 double GetLoadingProgress() const override; | 51 double GetLoadingProgress() const override; |
52 bool IsBeingDestroyed() const override; | 52 bool IsBeingDestroyed() const override; |
53 const GURL& GetVisibleURL() const override; | 53 const GURL& GetVisibleURL() const override; |
54 const GURL& GetLastCommittedURL() const override; | 54 const GURL& GetLastCommittedURL() const override; |
55 GURL GetCurrentURL(URLVerificationTrustLevel* trust_level) const override; | 55 GURL GetCurrentURL(URLVerificationTrustLevel* trust_level) const override; |
56 void ShowTransientContentView(CRWContentView* content_view) override {} | 56 void ShowTransientContentView(CRWContentView* content_view) override; |
| 57 void ClearTransientContentView(); |
57 void AddScriptCommandCallback(const ScriptCommandCallback& callback, | 58 void AddScriptCommandCallback(const ScriptCommandCallback& callback, |
58 const std::string& command_prefix) override {} | 59 const std::string& command_prefix) override {} |
59 void RemoveScriptCommandCallback(const std::string& command_prefix) override { | 60 void RemoveScriptCommandCallback(const std::string& command_prefix) override { |
60 } | 61 } |
61 CRWWebViewProxyType GetWebViewProxy() const override; | 62 CRWWebViewProxyType GetWebViewProxy() const override; |
62 bool IsShowingWebInterstitial() const override; | 63 bool IsShowingWebInterstitial() const override; |
63 WebInterstitial* GetWebInterstitial() const override; | 64 WebInterstitial* GetWebInterstitial() const override; |
64 void OnPasswordInputShownOnHttp() override {} | 65 void OnPasswordInputShownOnHttp() override {} |
65 void OnCreditCardInputShownOnHttp() override {} | 66 void OnCreditCardInputShownOnHttp() override {} |
66 | 67 |
(...skipping 10 matching lines...) Expand all Loading... |
77 // Setters for test data. | 78 // Setters for test data. |
78 void SetBrowserState(BrowserState* browser_state); | 79 void SetBrowserState(BrowserState* browser_state); |
79 void SetContentIsHTML(bool content_is_html); | 80 void SetContentIsHTML(bool content_is_html); |
80 void SetLoading(bool is_loading); | 81 void SetLoading(bool is_loading); |
81 void SetCurrentURL(const GURL& url); | 82 void SetCurrentURL(const GURL& url); |
82 void SetTrustLevel(URLVerificationTrustLevel trust_level); | 83 void SetTrustLevel(URLVerificationTrustLevel trust_level); |
83 void SetNavigationManager( | 84 void SetNavigationManager( |
84 std::unique_ptr<NavigationManager> navigation_manager); | 85 std::unique_ptr<NavigationManager> navigation_manager); |
85 void SetView(UIView* view); | 86 void SetView(UIView* view); |
86 | 87 |
| 88 // Getters for test data. |
| 89 bool IsShowingTransientContentView(); |
| 90 |
87 // Notifier for tests. | 91 // Notifier for tests. |
88 void OnPageLoaded(PageLoadCompletionStatus load_completion_status); | 92 void OnPageLoaded(PageLoadCompletionStatus load_completion_status); |
89 void OnProvisionalNavigationStarted(const GURL& url); | 93 void OnProvisionalNavigationStarted(const GURL& url); |
| 94 void OnRenderProcessGone(); |
90 | 95 |
91 private: | 96 private: |
92 BrowserState* browser_state_; | 97 BrowserState* browser_state_; |
93 bool web_usage_enabled_; | 98 bool web_usage_enabled_; |
94 bool is_loading_; | 99 bool is_loading_; |
| 100 bool is_showing_transient_content_view_; |
95 GURL url_; | 101 GURL url_; |
96 base::string16 title_; | 102 base::string16 title_; |
97 URLVerificationTrustLevel trust_level_; | 103 URLVerificationTrustLevel trust_level_; |
98 bool content_is_html_; | 104 bool content_is_html_; |
99 std::string mime_type_; | 105 std::string mime_type_; |
100 std::string content_language_; | 106 std::string content_language_; |
101 std::unique_ptr<NavigationManager> navigation_manager_; | 107 std::unique_ptr<NavigationManager> navigation_manager_; |
102 base::scoped_nsobject<UIView> view_; | 108 base::scoped_nsobject<UIView> view_; |
103 | 109 |
104 // A list of observers notified when page state changes. Weak references. | 110 // A list of observers notified when page state changes. Weak references. |
105 base::ObserverList<WebStateObserver, true> observers_; | 111 base::ObserverList<WebStateObserver, true> observers_; |
106 }; | 112 }; |
107 | 113 |
108 } // namespace web | 114 } // namespace web |
109 | 115 |
110 #endif // IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_STATE_H_ | 116 #endif // IOS_WEB_PUBLIC_TEST_FAKES_TEST_WEB_STATE_H_ |
OLD | NEW |