Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / public / web / WebPageImportanceSignals.h
blob7328c435c5ed62da1968b88d21559bad6e60437d
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
3 // found in the LICENSE file.
5 #ifndef WebPageImportanceSignals_h
6 #define WebPageImportanceSignals_h
8 #include "public/platform/WebCommon.h"
10 namespace blink {
12 class WebViewClient;
14 // WebPageImportanceSignals indicate the importance of the page state to user.
15 // This signal is propagated to embedder so that it can prioritize preserving
16 // state of certain page over the others.
17 class WebPageImportanceSignals {
18 public:
19 WebPageImportanceSignals() { reset(); }
21 bool hadFormInteraction() const { return m_hadFormInteraction; }
22 void setHadFormInteraction();
24 BLINK_EXPORT void reset();
25 #if BLINK_IMPLEMENTATION
26 void onCommitLoad();
27 #endif
29 void setObserver(WebViewClient* observer) { m_observer = observer; }
31 private:
32 bool m_hadFormInteraction : 1;
33 WebViewClient* m_observer = nullptr;
36 } // namespace blink
38 #endif // WebPageImportancesignals_h