Index: components/search_engines/template_url_fetcher.cc |
diff --git a/components/search_engines/template_url_fetcher.cc b/components/search_engines/template_url_fetcher.cc |
index cf972d0eeb915643151d183a8757c22f6fabeb78..68636b96c3e92ac2039a549861bac6fcca00ef40 100644 |
--- a/components/search_engines/template_url_fetcher.cc |
+++ b/components/search_engines/template_url_fetcher.cc |
@@ -13,11 +13,37 @@ |
#include "components/search_engines/template_url_parser.h" |
#include "components/search_engines/template_url_service.h" |
#include "net/base/load_flags.h" |
+#include "net/traffic_annotation/network_traffic_annotation.h" |
#include "net/url_request/url_fetcher.h" |
#include "net/url_request/url_fetcher_delegate.h" |
#include "net/url_request/url_request_context_getter.h" |
#include "net/url_request/url_request_status.h" |
+namespace { |
+// Traffic annotation for ReqeustDelegate |
+constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation = |
+ net::DefineNetworkTrafficAnnotation("open_search", R"( |
+ semantics { |
+ sender: "Open Search Fetcher" |
Peter Kasting
2017/02/24 23:33:09
I think this should be Omnibox, as that's ultimate
Ramin Halavati
2017/02/27 09:07:57
Done.
vasilii
2017/02/27 13:14:01
Peter, why omnibox? If I search for "yandex" and t
Peter Kasting
2017/02/27 21:07:10
Because that's what these search engines are actua
|
+ description: |
+ "The web pages can include an OpenSearch description doc in their " |
Peter Kasting
2017/02/24 23:33:09
Nit: No "the"
Ramin Halavati
2017/02/27 09:07:57
Done.
|
+ "HTML. In this case Chromium downloads and parses the file. The " |
Peter Kasting
2017/02/24 23:33:09
Is merely visiting the page, and not actually usin
vasilii
2017/02/27 12:13:05
Yes, you can land on https://yandex.ru/ and observ
|
+ "corresponding search engine is added to the list in the browser " |
+ "(chrome://settings/searchEngines)." |
+ trigger: |
+ "User visits a web page containing <link rel="search"> tag." |
Peter Kasting
2017/02/24 23:33:09
Nit: Two spaces after "containing" should be " a "
Ramin Halavati
2017/02/27 09:07:57
Done.
|
+ data: "None" |
+ destination: WEBSITE |
+ } |
+ policy { |
+ cookies_allowed: false |
vasilii
2017/02/24 15:05:43
true
|
+ setting: "This feature cannot be disabled in settings." |
+ policy_exception_justification: |
+ "Not implemented, considered not useful as this feature does not " |
+ "upload any data." |
Peter Kasting
2017/02/24 23:33:09
Since we send cookies, this seems incorrect.
Mayb
vasilii
2017/02/27 12:13:06
I didn't find anything related to cookies in the s
|
+ })"); |
+} // namespace |
+ |
// RequestDelegate ------------------------------------------------------------ |
class TemplateURLFetcher::RequestDelegate : public net::URLFetcherDelegate { |
public: |
@@ -61,8 +87,10 @@ TemplateURLFetcher::RequestDelegate::RequestDelegate( |
const GURL& osdd_url, |
const GURL& favicon_url, |
const URLFetcherCustomizeCallback& url_fetcher_customize_callback) |
- : url_fetcher_( |
- net::URLFetcher::Create(osdd_url, net::URLFetcher::GET, this)), |
+ : url_fetcher_(net::URLFetcher::Create(osdd_url, |
+ net::URLFetcher::GET, |
+ this, |
+ kTrafficAnnotation)), |
fetcher_(fetcher), |
keyword_(keyword), |
osdd_url_(osdd_url), |