| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |