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