| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/doodle/doodle_fetcher_impl.h" | 5 #include "components/doodle/doodle_fetcher_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 "The user's Google cookies. Used for example to show birthday " | 91 "The user's Google cookies. Used for example to show birthday " |
| 92 "doodles at appropriate times." | 92 "doodles at appropriate times." |
| 93 destination: GOOGLE_OWNED_SERVICE | 93 destination: GOOGLE_OWNED_SERVICE |
| 94 } | 94 } |
| 95 policy { | 95 policy { |
| 96 cookies_allowed: true | 96 cookies_allowed: true |
| 97 cookies_store: "user" | 97 cookies_store: "user" |
| 98 setting: | 98 setting: |
| 99 "Choosing a non-Google search engine in Chromium settings under " | 99 "Choosing a non-Google search engine in Chromium settings under " |
| 100 "'Search Engine' will disable this feature." | 100 "'Search Engine' will disable this feature." |
| 101 policy_exception_justification: | 101 chrome_policy { |
| 102 "Not implemented, considered not useful as it does not upload any " | 102 DefaultSearchProviderEnabled { |
| 103 "data." | 103 policy_options {mode: MANDATORY} |
| 104 DefaultSearchProviderEnabled: false |
| 105 } |
| 106 } |
| 104 })"); | 107 })"); |
| 105 fetcher_ = URLFetcher::Create( | 108 fetcher_ = URLFetcher::Create( |
| 106 BuildDoodleURL(GetGoogleBaseUrl(), gray_background_, override_url_), | 109 BuildDoodleURL(GetGoogleBaseUrl(), gray_background_, override_url_), |
| 107 URLFetcher::GET, this, traffic_annotation); | 110 URLFetcher::GET, this, traffic_annotation); |
| 108 fetcher_->SetRequestContext(download_context_.get()); | 111 fetcher_->SetRequestContext(download_context_.get()); |
| 109 // TODO(treib): Use OAuth2 authentication instead of cookies. crbug.com/711314 | 112 // TODO(treib): Use OAuth2 authentication instead of cookies. crbug.com/711314 |
| 110 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_AUTH_DATA); | 113 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_AUTH_DATA); |
| 111 fetcher_->SetAutomaticallyRetryOnNetworkChanges(1); | 114 fetcher_->SetAutomaticallyRetryOnNetworkChanges(1); |
| 112 data_use_measurement::DataUseUserData::AttachToFetcher( | 115 data_use_measurement::DataUseUserData::AttachToFetcher( |
| 113 fetcher_.get(), data_use_measurement::DataUseUserData::DOODLE); | 116 fetcher_.get(), data_use_measurement::DataUseUserData::DOODLE); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 207 |
| 205 GURL DoodleFetcherImpl::GetGoogleBaseUrl() const { | 208 GURL DoodleFetcherImpl::GetGoogleBaseUrl() const { |
| 206 GURL cmd_line_url = google_util::CommandLineGoogleBaseURL(); | 209 GURL cmd_line_url = google_util::CommandLineGoogleBaseURL(); |
| 207 if (cmd_line_url.is_valid()) { | 210 if (cmd_line_url.is_valid()) { |
| 208 return cmd_line_url; | 211 return cmd_line_url; |
| 209 } | 212 } |
| 210 return google_url_tracker_->google_url(); | 213 return google_url_tracker_->google_url(); |
| 211 } | 214 } |
| 212 | 215 |
| 213 } // namespace doodle | 216 } // namespace doodle |
| OLD | NEW |