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

Side by Side Diff: chrome/browser/ui/webui/snippets_internals_message_handler.cc

Issue 2000233002: [NTP Snippets] Unschedule fetches when the service should be disabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SnippetsDB
Patch Set: fix typos Created 4 years, 6 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
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 "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 <vector> 9 #include <vector>
10 10
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 DCHECK_EQ(0u, args->GetSize()); 114 DCHECK_EQ(0u, args->GetSize());
115 115
116 ntp_snippets_service_->ClearSnippets(); 116 ntp_snippets_service_->ClearSnippets();
117 } 117 }
118 118
119 void SnippetsInternalsMessageHandler::HandleClearDiscarded( 119 void SnippetsInternalsMessageHandler::HandleClearDiscarded(
120 const base::ListValue* args) { 120 const base::ListValue* args) {
121 DCHECK_EQ(0u, args->GetSize()); 121 DCHECK_EQ(0u, args->GetSize());
122 122
123 ntp_snippets_service_->ClearDiscardedSnippets(); 123 ntp_snippets_service_->ClearDiscardedSnippets();
124 ntp_snippets_service_->FetchSnippets();
Marc Treib 2016/06/07 08:55:39 Hm. So this is the only call site for ClearDiscard
dgn 2016/06/07 11:22:46 I think so too. And when debugging the ntp, after
124 SendDiscardedSnippets(); 125 SendDiscardedSnippets();
125 } 126 }
126 127
127 void SnippetsInternalsMessageHandler::HandleDownload( 128 void SnippetsInternalsMessageHandler::HandleDownload(
128 const base::ListValue* args) { 129 const base::ListValue* args) {
129 DCHECK_EQ(1u, args->GetSize()); 130 DCHECK_EQ(1u, args->GetSize());
130 131
131 SendString("hosts-status", std::string()); 132 SendString("hosts-status", std::string());
132 133
133 std::string hosts_string; 134 std::string hosts_string;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 } 225 }
225 226
226 void SnippetsInternalsMessageHandler::SendString(const std::string& name, 227 void SnippetsInternalsMessageHandler::SendString(const std::string& name,
227 const std::string& value) { 228 const std::string& value) {
228 base::StringValue string_name(name); 229 base::StringValue string_name(name);
229 base::StringValue string_value(value); 230 base::StringValue string_value(value);
230 231
231 web_ui()->CallJavascriptFunction("chrome.SnippetsInternals.receiveProperty", 232 web_ui()->CallJavascriptFunction("chrome.SnippetsInternals.receiveProperty",
232 string_name, string_value); 233 string_name, string_value);
233 } 234 }
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/ntp_snippets_service.h » ('j') | components/ntp_snippets/ntp_snippets_service.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698