Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Unified Diff: components/quirks/quirks_client.cc

Issue 2765703003: Include display names in Quirks URL (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/quirks/quirks_client.h ('k') | components/quirks/quirks_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/quirks/quirks_client.cc
diff --git a/components/quirks/quirks_client.cc b/components/quirks/quirks_client.cc
index b949a329cc7b4413e35269920b66eb6471d56ed5..b50f4526c4a4f2b5a2d58568463923aa621e9341 100644
--- a/components/quirks/quirks_client.cc
+++ b/components/quirks/quirks_client.cc
@@ -13,6 +13,7 @@
#include "components/prefs/scoped_user_pref_update.h"
#include "components/quirks/quirks_manager.h"
#include "components/version_info/version_info.h"
+#include "net/base/escape.h"
#include "net/base/load_flags.h"
#include "net/http/http_status_code.h"
#include "net/url_request/url_fetcher.h"
@@ -24,7 +25,7 @@ namespace {
const char kQuirksUrlFormat[] =
"https://chromeosquirksserver-pa.googleapis.com/v2/display/%s/clients"
- "/chromeos/M%d";
+ "/chromeos/M%d?";
const int kMaxServerFailures = 10;
@@ -54,9 +55,11 @@ bool WriteIccFile(const base::FilePath file_path, const std::string& data) {
// QuirksClient
QuirksClient::QuirksClient(int64_t product_id,
+ const std::string& display_name,
const RequestFinishedCallback& on_request_finished,
QuirksManager* manager)
: product_id_(product_id),
+ display_name_(display_name),
on_request_finished_(on_request_finished),
manager_(manager),
icc_path_(manager->delegate()->GetDisplayProfileDirectory().Append(
@@ -74,11 +77,15 @@ void QuirksClient::StartDownload() {
std::string url = base::StringPrintf(
kQuirksUrlFormat, IdToHexString(product_id_).c_str(), major_version);
+ if (!display_name_.empty()) {
+ url +=
+ "display_name=" + net::EscapeQueryParamValue(display_name_, true) + "&";
+ }
+
VLOG(2) << "Preparing to download\n " << url << "\nto file "
<< icc_path_.value();
- url += "?key=";
- url += manager_->delegate()->GetApiKey();
+ url += "key=" + manager_->delegate()->GetApiKey();
url_fetcher_ = manager_->CreateURLFetcher(GURL(url), this);
url_fetcher_->SetRequestContext(manager_->url_context_getter());
« no previous file with comments | « components/quirks/quirks_client.h ('k') | components/quirks/quirks_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698