| 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; |
| 13 |
| 12 // WebPageImportanceSignals indicate the importance of the page state to user. | 14 // WebPageImportanceSignals indicate the importance of the page state to user. |
| 13 // 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 |
| 14 // state of certain page over the others. | 16 // state of certain page over the others. |
| 15 class WebPageImportanceSignals { | 17 class WebPageImportanceSignals { |
| 16 public: | 18 public: |
| 17 WebPageImportanceSignals() { reset(); } | 19 WebPageImportanceSignals() { reset(); } |
| 18 | 20 |
| 19 bool hadFormInteraction() const { return m_hadFormInteraction; } | 21 bool hadFormInteraction() const { return m_hadFormInteraction; } |
| 20 void setHadFormInteraction() { m_hadFormInteraction = true; } | 22 void setHadFormInteraction(); |
| 21 | 23 |
| 22 BLINK_EXPORT void reset(); | 24 BLINK_EXPORT void reset(); |
| 23 #if BLINK_IMPLEMENTATION | 25 #if BLINK_IMPLEMENTATION |
| 24 void onCommitLoad(); | 26 void onCommitLoad(); |
| 25 #endif | 27 #endif |
| 26 | 28 |
| 29 void setObserver(WebViewClient* observer) { m_observer = observer; } |
| 30 |
| 27 private: | 31 private: |
| 28 bool m_hadFormInteraction : 1; | 32 bool m_hadFormInteraction : 1; |
| 33 WebViewClient* m_observer = nullptr; |
| 29 }; | 34 }; |
| 30 | 35 |
| 31 } // namespace blink | 36 } // namespace blink |
| 32 | 37 |
| 33 #endif // WebPageImportancesignals_h | 38 #endif // WebPageImportancesignals_h |
| OLD | NEW |