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

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

Issue 2230473002: Refactor and extend SnippetsBridge for multi-section support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@categoryinfo
Patch Set: Created 4 years, 4 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 } // namespace 103 } // namespace
104 104
105 SnippetsInternalsMessageHandler::SnippetsInternalsMessageHandler() 105 SnippetsInternalsMessageHandler::SnippetsInternalsMessageHandler()
106 : content_suggestions_service_observer_(this), 106 : content_suggestions_service_observer_(this),
107 dom_loaded_(false), 107 dom_loaded_(false),
108 ntp_snippets_service_(nullptr), 108 ntp_snippets_service_(nullptr),
109 content_suggestions_service_(nullptr) {} 109 content_suggestions_service_(nullptr) {}
110 110
111 SnippetsInternalsMessageHandler::~SnippetsInternalsMessageHandler() {} 111 SnippetsInternalsMessageHandler::~SnippetsInternalsMessageHandler() {}
112 112
113 void SnippetsInternalsMessageHandler::OnNewSuggestions() { 113 void SnippetsInternalsMessageHandler::OnNewSuggestions(Category category) {
114 if (!dom_loaded_) 114 if (!dom_loaded_)
115 return; 115 return;
116 SendContentSuggestions(); 116 SendContentSuggestions();
117 } 117 }
118 118
119 void SnippetsInternalsMessageHandler::OnCategoryStatusChanged( 119 void SnippetsInternalsMessageHandler::OnCategoryStatusChanged(
120 Category category, 120 Category category,
121 CategoryStatus new_status) { 121 CategoryStatus new_status) {
122 if (!dom_loaded_) 122 if (!dom_loaded_)
123 return; 123 return;
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 } 348 }
349 349
350 void SnippetsInternalsMessageHandler::SendString(const std::string& name, 350 void SnippetsInternalsMessageHandler::SendString(const std::string& name,
351 const std::string& value) { 351 const std::string& value) {
352 base::StringValue string_name(name); 352 base::StringValue string_name(name);
353 base::StringValue string_value(value); 353 base::StringValue string_value(value);
354 354
355 web_ui()->CallJavascriptFunctionUnsafe( 355 web_ui()->CallJavascriptFunctionUnsafe(
356 "chrome.SnippetsInternals.receiveProperty", string_name, string_value); 356 "chrome.SnippetsInternals.receiveProperty", string_name, string_value);
357 } 357 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/snippets_internals_message_handler.h ('k') | components/ntp_snippets/content_suggestions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698