OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/page_load_metrics/metrics_navigation_throttle.h" |
| 6 |
| 7 #include "base/memory/ptr_util.h" |
| 8 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h" |
| 9 #include "content/public/browser/navigation_handle.h" |
| 10 |
| 11 namespace page_load_metrics { |
| 12 |
| 13 // static |
| 14 std::unique_ptr<content::NavigationThrottle> MetricsNavigationThrottle::Create( |
| 15 content::NavigationHandle* handle) { |
| 16 return base::WrapUnique(new MetricsNavigationThrottle(handle)); |
| 17 } |
| 18 |
| 19 MetricsNavigationThrottle::~MetricsNavigationThrottle() {} |
| 20 |
| 21 content::NavigationThrottle::ThrottleCheckResult |
| 22 MetricsNavigationThrottle::WillStartRequest() { |
| 23 MetricsWebContentsObserver* observer = |
| 24 MetricsWebContentsObserver::FromWebContents( |
| 25 navigation_handle()->GetWebContents()); |
| 26 if (observer) |
| 27 observer->WillStartNavigationRequest(navigation_handle()); |
| 28 return content::NavigationThrottle::PROCEED; |
| 29 } |
| 30 |
| 31 MetricsNavigationThrottle::MetricsNavigationThrottle( |
| 32 content::NavigationHandle* handle) |
| 33 : content::NavigationThrottle(handle) {} |
| 34 |
| 35 } // namespace page_load_metrics |
OLD | NEW |