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

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

Issue 2214683002: [New CL] Add bookmark provider for content suggestions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Insert a blank line 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 } 76 }
77 77
78 // TODO(pke): Replace this as soon as the service delivers the title directly. 78 // TODO(pke): Replace this as soon as the service delivers the title directly.
79 std::string GetCategoryTitle(Category category) { 79 std::string GetCategoryTitle(Category category) {
80 if (category.IsKnownCategory(KnownCategories::ARTICLES)) { 80 if (category.IsKnownCategory(KnownCategories::ARTICLES)) {
81 return "Articles"; 81 return "Articles";
82 } 82 }
83 if (category.IsKnownCategory(KnownCategories::OFFLINE_PAGES)) { 83 if (category.IsKnownCategory(KnownCategories::OFFLINE_PAGES)) {
84 return "Offline pages (continue browsing)"; 84 return "Offline pages (continue browsing)";
85 } 85 }
86 if (category.IsKnownCategory(KnownCategories::BOOKMARKS)) {
87 return "Recently visited bookmarks";
88 }
86 return std::string(); 89 return std::string();
87 } 90 }
88 91
89 std::string GetCategoryStatusName(CategoryStatus status) { 92 std::string GetCategoryStatusName(CategoryStatus status) {
90 switch (status) { 93 switch (status) {
91 case CategoryStatus::INITIALIZING: 94 case CategoryStatus::INITIALIZING:
92 return "INITIALIZING"; 95 return "INITIALIZING";
93 case CategoryStatus::AVAILABLE: 96 case CategoryStatus::AVAILABLE:
94 return "AVAILABLE"; 97 return "AVAILABLE";
95 case CategoryStatus::AVAILABLE_LOADING: 98 case CategoryStatus::AVAILABLE_LOADING:
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 } 355 }
353 356
354 void SnippetsInternalsMessageHandler::SendString(const std::string& name, 357 void SnippetsInternalsMessageHandler::SendString(const std::string& name,
355 const std::string& value) { 358 const std::string& value) {
356 base::StringValue string_name(name); 359 base::StringValue string_name(name);
357 base::StringValue string_value(value); 360 base::StringValue string_value(value);
358 361
359 web_ui()->CallJavascriptFunctionUnsafe( 362 web_ui()->CallJavascriptFunctionUnsafe(
360 "chrome.SnippetsInternals.receiveProperty", string_name, string_value); 363 "chrome.SnippetsInternals.receiveProperty", string_name, string_value);
361 } 364 }
OLDNEW
« no previous file with comments | « chrome/browser/ntp_snippets/content_suggestions_service_factory.cc ('k') | components/ntp_snippets.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698