OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_SERVICE_H_ |
6 #define CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_SERVICE_H_ | 6 #define CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <unordered_set> | 9 #include <unordered_set> |
10 | 10 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 | 56 |
57 // Called every time the WebContents changes visibility. Propagates the event | 57 // Called every time the WebContents changes visibility. Propagates the event |
58 // to the |ascriber_| on the IO thread. | 58 // to the |ascriber_| on the IO thread. |
59 void WasShownOrHidden(content::RenderFrameHost* main_render_frame_host, | 59 void WasShownOrHidden(content::RenderFrameHost* main_render_frame_host, |
60 bool visible); | 60 bool visible); |
61 | 61 |
62 // Called when one of the render frames of a WebContents is swapped. | 62 // Called when one of the render frames of a WebContents is swapped. |
63 void RenderFrameHostChanged(content::RenderFrameHost* old_host, | 63 void RenderFrameHostChanged(content::RenderFrameHost* old_host, |
64 content::RenderFrameHost* new_host); | 64 content::RenderFrameHost* new_host); |
65 | 65 |
| 66 // Forwarded from DataUseWebContentsObserver |
| 67 void DidFinishNavigation(content::NavigationHandle* navigation_handle); |
| 68 |
66 private: | 69 private: |
67 friend class ChromeDataUseAscriberServiceTest; | 70 friend class ChromeDataUseAscriberServiceTest; |
68 | 71 |
69 void SetDataUseAscriber(ChromeDataUseAscriber* ascriber); | 72 void SetDataUseAscriber(ChromeDataUseAscriber* ascriber); |
70 | 73 |
71 // |ascriber_| outlives this instance. | 74 // |ascriber_| outlives this instance. |
72 ChromeDataUseAscriber* ascriber_; | 75 ChromeDataUseAscriber* ascriber_; |
73 | 76 |
74 // Tracks whether |ascriber_| was set. This field is required because tests | 77 // Tracks whether |ascriber_| was set. This field is required because tests |
75 // might set |ascriber_| to nullptr. | 78 // might set |ascriber_| to nullptr. |
(...skipping 10 matching lines...) Expand all Loading... |
86 // |ascriber_| is set. Sucn pending main render frame visibile events are | 89 // |ascriber_| is set. Sucn pending main render frame visibile events are |
87 // maintained in this set and propagated immediately after |ascriber_| is set. | 90 // maintained in this set and propagated immediately after |ascriber_| is set. |
88 std::unordered_set<content::RenderFrameHost*> pending_visible_main_frames_; | 91 std::unordered_set<content::RenderFrameHost*> pending_visible_main_frames_; |
89 | 92 |
90 DISALLOW_COPY_AND_ASSIGN(ChromeDataUseAscriberService); | 93 DISALLOW_COPY_AND_ASSIGN(ChromeDataUseAscriberService); |
91 }; | 94 }; |
92 | 95 |
93 } // namespace data_use_measurement | 96 } // namespace data_use_measurement |
94 | 97 |
95 #endif // CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_SERVICE_
H_ | 98 #endif // CHROME_BROWSER_DATA_USE_MEASUREMENT_CHROME_DATA_USE_ASCRIBER_SERVICE_
H_ |
OLD | NEW |