Chromium Code Reviews| Index: chrome/browser/ui/omnibox/chrome_omnibox_client.cc |
| diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc |
| index 3e12199b9ce6e01a39cd809637a45215c28636ef..277eeabc38b48d017569cf68d3dba223313b89b1 100644 |
| --- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc |
| +++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc |
| @@ -48,6 +48,7 @@ |
| #include "content/public/browser/navigation_entry.h" |
| #include "content/public/browser/web_contents.h" |
| #include "extensions/common/constants.h" |
| +#include "net/traffic_annotation/network_traffic_annotation.h" |
| #include "third_party/skia/include/core/SkBitmap.h" |
| #include "ui/base/window_open_disposition.h" |
| #include "url/gurl.h" |
| @@ -289,11 +290,53 @@ void ChromeOmniboxClient::OnResultChanged( |
| BitmapFetcherServiceFactory::GetForBrowserContext(profile_); |
| if (image_service) { |
| image_service->CancelRequest(request_id_); |
| + |
| + // TODO(jdonnelly@, rhalavati@): Create a helper function with Callback |
|
Justin Donnelly
2017/02/16 14:53:18
Same here.
Ramin Halavati
2017/02/17 06:30:12
Done.
|
| + // to create annotation and pass it to image_service, merging this |
| + // annotation and the one in |
| + // "c/b/autocomplete/chrome_autocomplete_provider_client.cc". |
| + net::NetworkTrafficAnnotationTag traffic_annotation = |
| + net::DefineNetworkTrafficAnnotation("omnibox_result_change", R"( |
| + semantics { |
| + sender: "Omnibox Suggest" |
| + description: |
| + "Google Chrome provides answers in the suggestion list to the " |
| + "queries you type in the omnibox. This request retrieves a " |
| + "small image (for example, an icon illustrating the current " |
| + "weather conditions) when this can add information to the " |
| + "answer." |
| + trigger: |
| + "Change of results for the query typed by the user in the " |
| + "omnibox." |
| + data: |
| + "The only data sent is the path to an image. No user data is " |
| + "included, although the general weather condition (sunny, " |
| + "rainy, etc.) in the user's current location could be inferred " |
| + "from the name of the image in the path." |
| + destination: WEBSITE |
| + } |
| + policy { |
| + cookies_allowed: true |
| + cookies_store: "user" |
| + setting: |
| + "You can enable or disable this feature via 'Use a prediction " |
| + "service to help complete searches and URLs typed in the " |
| + "address bar.' in Chrome's settings under Advanced. The " |
| + "feature is enabled by default." |
| + policy { |
| + SearchSuggestEnabled { |
| + policy_options {mode: MANDATORY} |
| + value: false |
| + } |
| + } |
| + })"); |
| + |
| request_id_ = image_service->RequestImage( |
| match->answer->second_line().image_url(), |
| new AnswerImageObserver( |
| base::Bind(&ChromeOmniboxClient::OnBitmapFetched, |
| - base::Unretained(this), on_bitmap_fetched))); |
| + base::Unretained(this), on_bitmap_fetched)), |
| + traffic_annotation); |
| } |
| } |
| } |