OLD | NEW |
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 "chrome/browser/ui/webui/snippets_internals_message_handler.h" | 5 #include "chrome/browser/ui/webui/snippets_internals_message_handler.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 case CategoryStatus::AVAILABLE: | 68 case CategoryStatus::AVAILABLE: |
69 return "AVAILABLE"; | 69 return "AVAILABLE"; |
70 case CategoryStatus::AVAILABLE_LOADING: | 70 case CategoryStatus::AVAILABLE_LOADING: |
71 return "AVAILABLE_LOADING"; | 71 return "AVAILABLE_LOADING"; |
72 case CategoryStatus::NOT_PROVIDED: | 72 case CategoryStatus::NOT_PROVIDED: |
73 return "NOT_PROVIDED"; | 73 return "NOT_PROVIDED"; |
74 case CategoryStatus::ALL_SUGGESTIONS_EXPLICITLY_DISABLED: | 74 case CategoryStatus::ALL_SUGGESTIONS_EXPLICITLY_DISABLED: |
75 return "ALL_SUGGESTIONS_EXPLICITLY_DISABLED"; | 75 return "ALL_SUGGESTIONS_EXPLICITLY_DISABLED"; |
76 case CategoryStatus::CATEGORY_EXPLICITLY_DISABLED: | 76 case CategoryStatus::CATEGORY_EXPLICITLY_DISABLED: |
77 return "CATEGORY_EXPLICITLY_DISABLED"; | 77 return "CATEGORY_EXPLICITLY_DISABLED"; |
78 case CategoryStatus::SIGNED_OUT: | |
79 return "SIGNED_OUT"; | |
80 case CategoryStatus::LOADING_ERROR: | 78 case CategoryStatus::LOADING_ERROR: |
81 return "LOADING_ERROR"; | 79 return "LOADING_ERROR"; |
82 } | 80 } |
83 return std::string(); | 81 return std::string(); |
84 } | 82 } |
85 | 83 |
86 } // namespace | 84 } // namespace |
87 | 85 |
88 SnippetsInternalsMessageHandler::SnippetsInternalsMessageHandler( | 86 SnippetsInternalsMessageHandler::SnippetsInternalsMessageHandler( |
89 ntp_snippets::ContentSuggestionsService* content_suggestions_service, | 87 ntp_snippets::ContentSuggestionsService* content_suggestions_service, |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( | 416 void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded( |
419 Category category, | 417 Category category, |
420 std::vector<ContentSuggestion> dismissed_suggestions) { | 418 std::vector<ContentSuggestion> dismissed_suggestions) { |
421 if (dismissed_state_[category] == DismissedState::HIDDEN) { | 419 if (dismissed_state_[category] == DismissedState::HIDDEN) { |
422 return; | 420 return; |
423 } | 421 } |
424 dismissed_suggestions_[category] = std::move(dismissed_suggestions); | 422 dismissed_suggestions_[category] = std::move(dismissed_suggestions); |
425 dismissed_state_[category] = DismissedState::VISIBLE; | 423 dismissed_state_[category] = DismissedState::VISIBLE; |
426 SendContentSuggestions(); | 424 SendContentSuggestions(); |
427 } | 425 } |
OLD | NEW |