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 "components/data_use_measurement/content/data_use_measurement_delegate_
imp.h" |
| 6 |
| 7 #include "content/public/browser/resource_request_info.h" |
| 8 |
| 9 namespace data_use_measurement { |
| 10 |
| 11 bool DataUseMeasurementDelegateImp::RequestIsFromUser( |
| 12 const net::URLRequest* request) { |
| 13 const content::ResourceRequestInfo* info = |
| 14 content::ResourceRequestInfo::ForRequest(request); |
| 15 // Having |info| is the sign of a request for a web content from user. For now |
| 16 // we could add a condition to check ProcessType in info is |
| 17 // content::PROCESS_TYPE_RENDERER, but it won't be compatible with upcoming |
| 18 // PlzNavigate architecture. So just existence of |info| is verified, and the |
| 19 // current check should be compatible with upcoming changes in PlzNavigate. |
| 20 return info != nullptr; |
| 21 } |
| 22 |
| 23 } // namespace data_use_measurement |
OLD | NEW |