| 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 WebPageImportanceSignals_h | 5 #ifndef WebPageImportanceSignals_h |
| 6 #define WebPageImportanceSignals_h | 6 #define WebPageImportanceSignals_h |
| 7 | 7 |
| 8 #include "public/platform/WebCommon.h" | 8 #include "public/platform/WebCommon.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class WebViewClient; | 12 class WebViewClient; |
| 13 | 13 |
| 14 // WebPageImportanceSignals indicate the importance of the page state to user. | 14 // WebPageImportanceSignals indicate the importance of the page state to user. |
| 15 // This signal is propagated to embedder so that it can prioritize preserving | 15 // This signal is propagated to embedder so that it can prioritize preserving |
| 16 // state of certain page over the others. | 16 // state of certain page over the others. |
| 17 class WebPageImportanceSignals { | 17 class WebPageImportanceSignals { |
| 18 public: | 18 public: |
| 19 WebPageImportanceSignals() { reset(); } | 19 WebPageImportanceSignals() { reset(); } |
| 20 | 20 |
| 21 bool hadFormInteraction() const { return m_hadFormInteraction; } | 21 bool hadFormInteraction() const { return m_hadFormInteraction; } |
| 22 void setHadFormInteraction(); | 22 void setHadFormInteraction(); |
| 23 bool issuedNonGetFetchFromScript() const { return m_issuedNonGetFetchFromScr
ipt; } |
| 24 void setIssuedNonGetFetchFromScript(); |
| 23 | 25 |
| 24 BLINK_EXPORT void reset(); | 26 BLINK_EXPORT void reset(); |
| 25 #if BLINK_IMPLEMENTATION | 27 #if BLINK_IMPLEMENTATION |
| 26 void onCommitLoad(); | 28 void onCommitLoad(); |
| 27 #endif | 29 #endif |
| 28 | 30 |
| 29 void setObserver(WebViewClient* observer) { m_observer = observer; } | 31 void setObserver(WebViewClient* observer) { m_observer = observer; } |
| 30 | 32 |
| 31 private: | 33 private: |
| 32 bool m_hadFormInteraction : 1; | 34 bool m_hadFormInteraction : 1; |
| 35 bool m_issuedNonGetFetchFromScript : 1; |
| 36 |
| 33 WebViewClient* m_observer = nullptr; | 37 WebViewClient* m_observer = nullptr; |
| 34 }; | 38 }; |
| 35 | 39 |
| 36 } // namespace blink | 40 } // namespace blink |
| 37 | 41 |
| 38 #endif // WebPageImportancesignals_h | 42 #endif // WebPageImportancesignals_h |
| OLD | NEW |