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

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

Issue 2228553003: a provider of Physical Web pages. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolved compile error. 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
« no previous file with comments | « chrome/browser/resources/snippets_internals.html ('k') | components/ntp_snippets.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 SendBoolean("flag-recent-offline-tab-suggestions", 194 SendBoolean("flag-recent-offline-tab-suggestions",
195 base::FeatureList::IsEnabled( 195 base::FeatureList::IsEnabled(
196 ntp_snippets::kRecentOfflineTabSuggestionsFeature)); 196 ntp_snippets::kRecentOfflineTabSuggestionsFeature));
197 SendBoolean( 197 SendBoolean(
198 "flag-download-suggestions", 198 "flag-download-suggestions",
199 base::FeatureList::IsEnabled(ntp_snippets::kDownloadSuggestionsFeature)); 199 base::FeatureList::IsEnabled(ntp_snippets::kDownloadSuggestionsFeature));
200 SendBoolean( 200 SendBoolean(
201 "flag-bookmark-suggestions", 201 "flag-bookmark-suggestions",
202 base::FeatureList::IsEnabled(ntp_snippets::kBookmarkSuggestionsFeature)); 202 base::FeatureList::IsEnabled(ntp_snippets::kBookmarkSuggestionsFeature));
203 203
204 SendBoolean("flag-physical-web-page-suggestions",
205 base::FeatureList::IsEnabled(
206 ntp_snippets::kPhysicalWebPageSuggestionsFeature));
207
204 web_ui()->CallJavascriptFunctionUnsafe( 208 web_ui()->CallJavascriptFunctionUnsafe(
205 "chrome.SnippetsInternals.setHostRestricted", 209 "chrome.SnippetsInternals.setHostRestricted",
206 base::FundamentalValue( 210 base::FundamentalValue(
207 ntp_snippets_service_->snippets_fetcher()->UsesHostRestrictions())); 211 ntp_snippets_service_->snippets_fetcher()->UsesHostRestrictions()));
208 212
209 switch (ntp_snippets_service_->snippets_fetcher()->personalization()) { 213 switch (ntp_snippets_service_->snippets_fetcher()->personalization()) {
210 case ntp_snippets::NTPSnippetsFetcher::Personalization::kPersonal: 214 case ntp_snippets::NTPSnippetsFetcher::Personalization::kPersonal:
211 SendString("switch-personalized", "Only personalized"); 215 SendString("switch-personalized", "Only personalized");
212 break; 216 break;
213 case ntp_snippets::NTPSnippetsFetcher::Personalization::kBoth: 217 case ntp_snippets::NTPSnippetsFetcher::Personalization::kBoth:
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 } 302 }
299 303
300 void SnippetsInternalsMessageHandler::SendString(const std::string& name, 304 void SnippetsInternalsMessageHandler::SendString(const std::string& name,
301 const std::string& value) { 305 const std::string& value) {
302 base::StringValue string_name(name); 306 base::StringValue string_name(name);
303 base::StringValue string_value(value); 307 base::StringValue string_value(value);
304 308
305 web_ui()->CallJavascriptFunctionUnsafe( 309 web_ui()->CallJavascriptFunctionUnsafe(
306 "chrome.SnippetsInternals.receiveProperty", string_name, string_value); 310 "chrome.SnippetsInternals.receiveProperty", string_name, string_value);
307 } 311 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/snippets_internals.html ('k') | components/ntp_snippets.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698