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 #include "config.h" | 5 #include "config.h" |
6 #include "public/web/WebPageImportanceSignals.h" | 6 #include "public/web/WebPageImportanceSignals.h" |
7 #include "public/web/WebViewClient.h" | |
8 | 7 |
9 #include "public/platform/Platform.h" | 8 #include "public/platform/Platform.h" |
| 9 #include "public/web/WebViewClient.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 void WebPageImportanceSignals::reset() | 13 void WebPageImportanceSignals::reset() |
14 { | 14 { |
15 m_hadFormInteraction = false; | 15 m_hadFormInteraction = false; |
| 16 m_issuedNonGetFetchFromScript = false; |
16 if (m_observer) | 17 if (m_observer) |
17 m_observer->pageImportanceSignalsChanged(); | 18 m_observer->pageImportanceSignalsChanged(); |
18 } | 19 } |
19 | 20 |
20 void WebPageImportanceSignals::setHadFormInteraction() | 21 void WebPageImportanceSignals::setHadFormInteraction() |
21 { | 22 { |
22 m_hadFormInteraction = true; | 23 m_hadFormInteraction = true; |
23 if (m_observer) | 24 if (m_observer) |
24 m_observer->pageImportanceSignalsChanged(); | 25 m_observer->pageImportanceSignalsChanged(); |
25 } | 26 } |
26 | 27 |
| 28 void WebPageImportanceSignals::setIssuedNonGetFetchFromScript() |
| 29 { |
| 30 m_issuedNonGetFetchFromScript = true; |
| 31 if (m_observer) |
| 32 m_observer->pageImportanceSignalsChanged(); |
| 33 } |
| 34 |
27 void WebPageImportanceSignals::onCommitLoad() | 35 void WebPageImportanceSignals::onCommitLoad() |
28 { | 36 { |
29 Platform::current()->histogramEnumeration("PageImportanceSignals.HadFormInte
raction.OnCommitLoad", m_hadFormInteraction, 2); | 37 Platform::current()->histogramEnumeration("PageImportanceSignals.HadFormInte
raction.OnCommitLoad", m_hadFormInteraction, 2); |
| 38 Platform::current()->histogramEnumeration("PageImportanceSignals.IssuedNonGe
tFetchFromScript.OnCommitLoad", m_issuedNonGetFetchFromScript, 2); |
30 | 39 |
31 reset(); | 40 reset(); |
32 } | 41 } |
33 | 42 |
34 } // namespace blink | 43 } // namespace blink |
OLD | NEW |