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

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

Issue 2812953002: Stop passing raw pointers to base::Value API in c/b/ui (Closed)
Patch Set: No ListValue::SetDouble Created 3 years, 8 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browsing_history_handler.h" 5 #include "chrome/browser/ui/webui/browsing_history_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 base::UTF16ToASCII(favicon::GetFallbackIconText(entry->url))); 187 base::UTF16ToASCII(favicon::GetFallbackIconText(entry->url)));
188 188
189 result->SetDouble("time", entry->time.ToJsTime()); 189 result->SetDouble("time", entry->time.ToJsTime());
190 190
191 // Pass the timestamps in a list. 191 // Pass the timestamps in a list.
192 std::unique_ptr<base::ListValue> timestamps(new base::ListValue); 192 std::unique_ptr<base::ListValue> timestamps(new base::ListValue);
193 for (std::set<int64_t>::const_iterator it = entry->all_timestamps.begin(); 193 for (std::set<int64_t>::const_iterator it = entry->all_timestamps.begin();
194 it != entry->all_timestamps.end(); ++it) { 194 it != entry->all_timestamps.end(); ++it) {
195 timestamps->AppendDouble(base::Time::FromInternalValue(*it).ToJsTime()); 195 timestamps->AppendDouble(base::Time::FromInternalValue(*it).ToJsTime());
196 } 196 }
197 result->Set("allTimestamps", timestamps.release()); 197 result->Set("allTimestamps", std::move(timestamps));
198 198
199 // Always pass the short date since it is needed both in the search and in 199 // Always pass the short date since it is needed both in the search and in
200 // the monthly view. 200 // the monthly view.
201 result->SetString("dateShort", base::TimeFormatShortDate(entry->time)); 201 result->SetString("dateShort", base::TimeFormatShortDate(entry->time));
202 202
203 base::string16 snippet_string; 203 base::string16 snippet_string;
204 base::string16 date_relative_day; 204 base::string16 date_relative_day;
205 base::string16 date_time_of_day; 205 base::string16 date_time_of_day;
206 bool is_blocked_visit = false; 206 bool is_blocked_visit = false;
207 int host_filtering_behavior = -1; 207 int host_filtering_behavior = -1;
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted"); 551 web_ui()->CallJavascriptFunctionUnsafe("historyDeleted");
552 } 552 }
553 553
554 void BrowsingHistoryHandler::HasOtherFormsOfBrowsingHistory( 554 void BrowsingHistoryHandler::HasOtherFormsOfBrowsingHistory(
555 bool has_other_forms, 555 bool has_other_forms,
556 bool has_synced_results) { 556 bool has_synced_results) {
557 web_ui()->CallJavascriptFunctionUnsafe("showNotification", 557 web_ui()->CallJavascriptFunctionUnsafe("showNotification",
558 base::Value(has_synced_results), 558 base::Value(has_synced_results),
559 base::Value(has_other_forms)); 559 base::Value(has_other_forms));
560 } 560 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_window_state.cc ('k') | chrome/browser/ui/webui/chromeos/drive_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698