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 had_form_interaction_; } | 21 bool HadFormInteraction() const { return had_form_interaction_; } |
22 void SetHadFormInteraction(); | 22 BLINK_EXPORT void SetHadFormInteraction(); |
23 bool IssuedNonGetFetchFromScript() const { | 23 bool IssuedNonGetFetchFromScript() const { |
24 return issued_non_get_fetch_from_script_; | 24 return issued_non_get_fetch_from_script_; |
25 } | 25 } |
26 void SetIssuedNonGetFetchFromScript(); | 26 BLINK_EXPORT void SetIssuedNonGetFetchFromScript(); |
27 | 27 |
28 BLINK_EXPORT void Reset(); | 28 BLINK_EXPORT void Reset(); |
29 #if BLINK_IMPLEMENTATION | 29 #if BLINK_IMPLEMENTATION |
30 void OnCommitLoad(); | 30 BLINK_EXPORT void OnCommitLoad(); |
31 #endif | 31 #endif |
32 | 32 |
33 void SetObserver(WebViewClient* observer) { observer_ = observer; } | 33 void SetObserver(WebViewClient* observer) { observer_ = observer; } |
34 | 34 |
35 private: | 35 private: |
36 bool had_form_interaction_ : 1; | 36 bool had_form_interaction_ : 1; |
37 bool issued_non_get_fetch_from_script_ : 1; | 37 bool issued_non_get_fetch_from_script_ : 1; |
38 | 38 |
39 WebViewClient* observer_ = nullptr; | 39 WebViewClient* observer_ = nullptr; |
40 }; | 40 }; |
41 | 41 |
42 } // namespace blink | 42 } // namespace blink |
43 | 43 |
44 #endif // WebPageImportancesignals_h | 44 #endif // WebPageImportancesignals_h |
OLD | NEW |