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

Side by Side Diff: components/ntp_snippets/remote/ntp_snippets_fetcher.cc

Issue 2449873003: [NTP Snippets] Another round of clang-tidy cleanups (Closed)
Patch Set: Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/ntp_snippets/remote/ntp_snippets_fetcher.h" 5 #include "components/ntp_snippets/remote/ntp_snippets_fetcher.h"
6 6
7 #include <cstdlib> 7 #include <cstdlib>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 // Wait until we get a refresh token. 357 // Wait until we get a refresh token.
358 waiting_for_refresh_token_ = true; 358 waiting_for_refresh_token_ = true;
359 token_service_->AddObserver(this); 359 token_service_->AddObserver(this);
360 } 360 }
361 } else { 361 } else {
362 // Not signed in: fetch snippets (without authentication). 362 // Not signed in: fetch snippets (without authentication).
363 FetchSnippetsNonAuthenticated(); 363 FetchSnippetsNonAuthenticated();
364 } 364 }
365 } 365 }
366 366
367 NTPSnippetsFetcher::RequestParams::RequestParams() 367 NTPSnippetsFetcher::RequestParams::RequestParams() = default;
368 : fetch_api(),
369 obfuscated_gaia_id(),
370 only_return_personalized_results(),
371 user_locale(),
372 host_restricts(),
373 count_to_fetch(),
374 interactive_request(),
375 user_class(),
376 ui_language{"", 0.0f},
377 other_top_language{"", 0.0f} {}
378 368
379 NTPSnippetsFetcher::RequestParams::~RequestParams() = default; 369 NTPSnippetsFetcher::RequestParams::~RequestParams() = default;
380 370
381 std::string NTPSnippetsFetcher::RequestParams::BuildRequest() { 371 std::string NTPSnippetsFetcher::RequestParams::BuildRequest() {
382 auto request = base::MakeUnique<base::DictionaryValue>(); 372 auto request = base::MakeUnique<base::DictionaryValue>();
383 switch (fetch_api) { 373 switch (fetch_api) {
384 case CHROME_READER_API: { 374 case CHROME_READER_API: {
385 auto content_params = base::MakeUnique<base::DictionaryValue>(); 375 auto content_params = base::MakeUnique<base::DictionaryValue>();
386 content_params->SetBoolean("only_return_personalized_results", 376 content_params->SetBoolean("only_return_personalized_results",
387 only_return_personalized_results); 377 only_return_personalized_results);
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 interactive_request); 780 interactive_request);
791 case UserClassifier::UserClass::ACTIVE_SUGGESTIONS_CONSUMER: 781 case UserClassifier::UserClass::ACTIVE_SUGGESTIONS_CONSUMER:
792 return request_throttler_active_suggestions_consumer_ 782 return request_throttler_active_suggestions_consumer_
793 .DemandQuotaForRequest(interactive_request); 783 .DemandQuotaForRequest(interactive_request);
794 } 784 }
795 NOTREACHED(); 785 NOTREACHED();
796 return false; 786 return false;
797 } 787 }
798 788
799 } // namespace ntp_snippets 789 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698