OLD | NEW |
| (Empty) |
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. | |
4 | |
5 #include "public/web/WebPageImportanceSignals.h" | |
6 | |
7 #include "platform/Histogram.h" | |
8 #include "public/web/WebViewClient.h" | |
9 | |
10 namespace blink { | |
11 | |
12 void WebPageImportanceSignals::Reset() { | |
13 had_form_interaction_ = false; | |
14 issued_non_get_fetch_from_script_ = false; | |
15 if (observer_) | |
16 observer_->PageImportanceSignalsChanged(); | |
17 } | |
18 | |
19 void WebPageImportanceSignals::SetHadFormInteraction() { | |
20 had_form_interaction_ = true; | |
21 if (observer_) | |
22 observer_->PageImportanceSignalsChanged(); | |
23 } | |
24 | |
25 void WebPageImportanceSignals::SetIssuedNonGetFetchFromScript() { | |
26 issued_non_get_fetch_from_script_ = true; | |
27 if (observer_) | |
28 observer_->PageImportanceSignalsChanged(); | |
29 } | |
30 | |
31 void WebPageImportanceSignals::OnCommitLoad() { | |
32 DEFINE_STATIC_LOCAL( | |
33 EnumerationHistogram, had_form_interaction_histogram, | |
34 ("PageImportanceSignals.HadFormInteraction.OnCommitLoad", 2)); | |
35 had_form_interaction_histogram.Count(had_form_interaction_); | |
36 | |
37 DEFINE_STATIC_LOCAL( | |
38 EnumerationHistogram, issued_non_get_histogram, | |
39 ("PageImportanceSignals.IssuedNonGetFetchFromScript.OnCommitLoad", 2)); | |
40 issued_non_get_histogram.Count(issued_non_get_fetch_from_script_); | |
41 | |
42 Reset(); | |
43 } | |
44 | |
45 } // namespace blink | |
OLD | NEW |