Chromium Code Reviews| Index: chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
| diff --git a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
| index 07c14bf90d3cb8e4a77c0e05df430983f6c46644..de1e78523a91be790d268fd8bc28b4c69975ad78 100644 |
| --- a/chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
| +++ b/chrome/browser/page_load_metrics/metrics_web_contents_observer.h |
| @@ -13,13 +13,16 @@ |
| #include "base/observer_list.h" |
| #include "base/time/time.h" |
| #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" |
| +#include "chrome/common/page_load_metrics/page_load_metrics.mojom.h" |
| #include "chrome/common/page_load_metrics/page_load_timing.h" |
| #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_data.h" |
| #include "content/public/browser/render_widget_host.h" |
| #include "content/public/browser/web_contents.h" |
| +#include "content/public/browser/web_contents_binding_set.h" |
| #include "content/public/browser/web_contents_observer.h" |
| #include "content/public/browser/web_contents_user_data.h" |
| #include "content/public/common/resource_type.h" |
| +#include "mojo/public/cpp/bindings/binding_set.h" |
| #include "third_party/WebKit/public/platform/WebInputEvent.h" |
| namespace content { |
| @@ -42,7 +45,8 @@ class PageLoadTracker; |
| class MetricsWebContentsObserver |
| : public content::WebContentsObserver, |
| public content::WebContentsUserData<MetricsWebContentsObserver>, |
| - public content::RenderWidgetHost::InputEventObserver { |
| + public content::RenderWidgetHost::InputEventObserver, |
| + public mojom::PageLoadMetrics { |
| public: |
| // TestingObserver allows tests to observe MetricsWebContentsObserver state |
| // changes. Tests may use TestingObserver to wait until certain state changes, |
| @@ -142,8 +146,20 @@ class MetricsWebContentsObserver |
| const PageLoadTiming& timing, |
| const PageLoadMetadata& metadata); |
| + content::WebContentsFrameBindingSet<mojom::PageLoadMetrics>& |
| + page_load_metrics_binding_for_testing() { |
|
Bryan McQuade
2017/05/07 19:44:41
looks like this is no longer used. remove?
lpy
2017/05/08 18:38:33
Done.
|
| + return page_load_metrics_binding_; |
| + } |
| + |
| private: |
| friend class content::WebContentsUserData<MetricsWebContentsObserver>; |
| + friend class FakePageLoadMetrics; |
|
Bryan McQuade
2017/05/07 19:44:41
can remove - this class doesn't appear to exist an
lpy
2017/05/08 18:38:33
Done.
|
| + friend class MetricsWebContentsObserverTest; |
|
Bryan McQuade
2017/05/07 19:44:41
can remove - don't need friend anymore
lpy
2017/05/08 18:38:33
Done.
|
| + friend class PageLoadMetricsObserverTestHarness; |
|
Bryan McQuade
2017/05/07 19:44:41
can remove - don't need friend anymore
lpy
2017/05/08 18:38:33
Done.
|
| + |
| + // page_load_metrics::mojom::PageLoadMetrics implementation. |
| + void UpdateTiming(const PageLoadTiming& timing, |
| + const PageLoadMetadata& metadata) override; |
| void HandleFailedNavigationForTrackedLoad( |
| content::NavigationHandle* navigation_handle, |
| @@ -212,6 +228,8 @@ class MetricsWebContentsObserver |
| bool has_navigated_; |
| base::ObserverList<TestingObserver> testing_observers_; |
| + content::WebContentsFrameBindingSet<mojom::PageLoadMetrics> |
| + page_load_metrics_binding_; |
| DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
| }; |