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

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

Issue 2667623002: [Remote suggestions] Clean up variation params in the status service (Closed)
Patch Set: Rebase Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/remote_suggestions_provider_impl.h" 5 #include "components/ntp_snippets/remote/remote_suggestions_provider_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 } else { 1014 } else {
1015 // Do not change the status. That will be done in EnterStateReady(). 1015 // Do not change the status. That will be done in EnterStateReady().
1016 EnterState(State::READY); 1016 EnterState(State::READY);
1017 } 1017 }
1018 break; 1018 break;
1019 1019
1020 case RemoteSuggestionsStatus::EXPLICITLY_DISABLED: 1020 case RemoteSuggestionsStatus::EXPLICITLY_DISABLED:
1021 EnterState(State::DISABLED); 1021 EnterState(State::DISABLED);
1022 UpdateAllCategoryStatus(CategoryStatus::CATEGORY_EXPLICITLY_DISABLED); 1022 UpdateAllCategoryStatus(CategoryStatus::CATEGORY_EXPLICITLY_DISABLED);
1023 break; 1023 break;
1024
1025 case RemoteSuggestionsStatus::SIGNED_OUT_AND_DISABLED:
1026 EnterState(State::DISABLED);
1027 UpdateAllCategoryStatus(CategoryStatus::SIGNED_OUT);
1028 break;
1029 } 1024 }
1030 } 1025 }
1031 1026
1032 void RemoteSuggestionsProviderImpl::EnterState(State state) { 1027 void RemoteSuggestionsProviderImpl::EnterState(State state) {
1033 if (state == state_) { 1028 if (state == state_) {
1034 return; 1029 return;
1035 } 1030 }
1036 1031
1037 UMA_HISTOGRAM_ENUMERATION("NewTabPage.Snippets.EnteredState", 1032 UMA_HISTOGRAM_ENUMERATION("NewTabPage.Snippets.EnteredState",
1038 static_cast<int>(state), 1033 static_cast<int>(state),
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 RemoteSuggestionsProviderImpl::CategoryContent::CategoryContent( 1270 RemoteSuggestionsProviderImpl::CategoryContent::CategoryContent(
1276 CategoryContent&&) = default; 1271 CategoryContent&&) = default;
1277 1272
1278 RemoteSuggestionsProviderImpl::CategoryContent::~CategoryContent() = default; 1273 RemoteSuggestionsProviderImpl::CategoryContent::~CategoryContent() = default;
1279 1274
1280 RemoteSuggestionsProviderImpl::CategoryContent& 1275 RemoteSuggestionsProviderImpl::CategoryContent&
1281 RemoteSuggestionsProviderImpl::CategoryContent::operator=(CategoryContent&&) = 1276 RemoteSuggestionsProviderImpl::CategoryContent::operator=(CategoryContent&&) =
1282 default; 1277 default;
1283 1278
1284 } // namespace ntp_snippets 1279 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/remote/remote_suggestions_provider_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698