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

Unified Diff: chrome/browser/ui/webui/snippets_internals_message_handler.cc

Issue 2668263002: [NTP::Cleanup] Add brackets in snippets_internals_message_handler.cc. (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/snippets_internals_message_handler.cc
diff --git a/chrome/browser/ui/webui/snippets_internals_message_handler.cc b/chrome/browser/ui/webui/snippets_internals_message_handler.cc
index b40f49d9f6f1746cbd5a721e47fd7bff8d8f11aa..8df849524ed6cb1f7ccee44cb8199bf41563dde7 100644
--- a/chrome/browser/ui/webui/snippets_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/snippets_internals_message_handler.cc
@@ -141,23 +141,26 @@ void SnippetsInternalsMessageHandler::RegisterMessages() {
}
void SnippetsInternalsMessageHandler::OnNewSuggestions(Category category) {
- if (!dom_loaded_)
+ if (!dom_loaded_) {
return;
+ }
SendContentSuggestions();
}
void SnippetsInternalsMessageHandler::OnCategoryStatusChanged(
Category category,
CategoryStatus new_status) {
- if (!dom_loaded_)
+ if (!dom_loaded_) {
return;
+ }
SendContentSuggestions();
}
void SnippetsInternalsMessageHandler::OnSuggestionInvalidated(
const ntp_snippets::ContentSuggestion::ID& suggestion_id) {
- if (!dom_loaded_)
+ if (!dom_loaded_) {
return;
+ }
SendContentSuggestions();
}
@@ -197,8 +200,9 @@ void SnippetsInternalsMessageHandler::HandleDownload(
SendString("remote-status", std::string());
- if (!remote_suggestions_provider_)
+ if (!remote_suggestions_provider_) {
return;
+ }
remote_suggestions_provider_->ReloadSuggestions();
}
@@ -208,8 +212,9 @@ void SnippetsInternalsMessageHandler::HandleClearCachedSuggestions(
DCHECK_EQ(1u, args->GetSize());
int category_id;
- if (!args->GetInteger(0, &category_id))
+ if (!args->GetInteger(0, &category_id)) {
return;
+ }
content_suggestions_service_->ClearCachedSuggestions(
Category::FromIDValue(category_id));
@@ -221,8 +226,9 @@ void SnippetsInternalsMessageHandler::HandleClearDismissedSuggestions(
DCHECK_EQ(1u, args->GetSize());
int category_id;
- if (!args->GetInteger(0, &category_id))
+ if (!args->GetInteger(0, &category_id)) {
return;
+ }
Category category = Category::FromIDValue(category_id);
content_suggestions_service_->ClearDismissedSuggestionsForDebugging(category);
@@ -239,11 +245,13 @@ void SnippetsInternalsMessageHandler::HandleToggleDismissedSuggestions(
DCHECK_EQ(2u, args->GetSize());
int category_id;
- if (!args->GetInteger(0, &category_id))
+ if (!args->GetInteger(0, &category_id)) {
return;
+ }
bool dismissed_visible;
- if (!args->GetBoolean(1, &dismissed_visible))
+ if (!args->GetBoolean(1, &dismissed_visible)) {
return;
+ }
Category category = Category::FromIDValue(category_id);
if (dismissed_visible) {
@@ -385,8 +393,9 @@ void SnippetsInternalsMessageHandler::SendContentSuggestions() {
const std::string& status =
remote_suggestions_provider_->suggestions_fetcher_for_debugging()
->last_status();
- if (!status.empty())
+ if (!status.empty()) {
SendString("remote-status", "Finished: " + status);
+ }
}
base::DictionaryValue result;
@@ -412,8 +421,9 @@ void SnippetsInternalsMessageHandler::SendString(const std::string& name,
void SnippetsInternalsMessageHandler::OnDismissedSuggestionsLoaded(
Category category,
std::vector<ContentSuggestion> dismissed_suggestions) {
- if (dismissed_state_[category] == DismissedState::HIDDEN)
+ if (dismissed_state_[category] == DismissedState::HIDDEN) {
return;
+ }
dismissed_suggestions_[category] = std::move(dismissed_suggestions);
dismissed_state_[category] = DismissedState::VISIBLE;
SendContentSuggestions();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698