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

Side by Side Diff: chrome/browser/extensions/extension_history_api.cc

Issue 3033050: Rename DictionaryValue's SetStringFromUTF16() to SetString() (and overload). (Closed)
Patch Set: There shouldn't be wstrings in platform-ind. code. Created 10 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 (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/extensions/extension_history_api.h" 5 #include "chrome/browser/extensions/extension_history_api.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/string_number_conversions.h" 10 #include "base/string_number_conversions.h"
(...skipping 12 matching lines...) Expand all
23 namespace { 23 namespace {
24 24
25 double MilliSecondsFromTime(const base::Time& time) { 25 double MilliSecondsFromTime(const base::Time& time) {
26 return 1000 * time.ToDoubleT(); 26 return 1000 * time.ToDoubleT();
27 } 27 }
28 28
29 void GetHistoryItemDictionary(const history::URLRow& row, 29 void GetHistoryItemDictionary(const history::URLRow& row,
30 DictionaryValue* value) { 30 DictionaryValue* value) {
31 value->SetString(keys::kIdKey, base::Int64ToString(row.id())); 31 value->SetString(keys::kIdKey, base::Int64ToString(row.id()));
32 value->SetString(keys::kUrlKey, row.url().spec()); 32 value->SetString(keys::kUrlKey, row.url().spec());
33 value->SetStringFromUTF16(keys::kTitleKey, row.title()); 33 value->SetString(keys::kTitleKey, row.title());
34 value->SetReal(keys::kLastVisitdKey, MilliSecondsFromTime(row.last_visit())); 34 value->SetReal(keys::kLastVisitdKey, MilliSecondsFromTime(row.last_visit()));
35 value->SetInteger(keys::kTypedCountKey, row.typed_count()); 35 value->SetInteger(keys::kTypedCountKey, row.typed_count());
36 value->SetInteger(keys::kVisitCountKey, row.visit_count()); 36 value->SetInteger(keys::kVisitCountKey, row.visit_count());
37 } 37 }
38 38
39 void AddHistoryNode(const history::URLRow& row, ListValue* list) { 39 void AddHistoryNode(const history::URLRow& row, ListValue* list) {
40 DictionaryValue* dict = new DictionaryValue(); 40 DictionaryValue* dict = new DictionaryValue();
41 GetHistoryItemDictionary(row, dict); 41 GetHistoryItemDictionary(row, dict);
42 list->Append(dict); 42 list->Append(dict);
43 } 43 }
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 base::Time::Now(), // To the current time. 367 base::Time::Now(), // To the current time.
368 &cancelable_consumer_, 368 &cancelable_consumer_,
369 NewCallback(this, &DeleteAllHistoryFunction::DeleteComplete)); 369 NewCallback(this, &DeleteAllHistoryFunction::DeleteComplete));
370 370
371 return true; 371 return true;
372 } 372 }
373 373
374 void DeleteAllHistoryFunction::DeleteComplete() { 374 void DeleteAllHistoryFunction::DeleteComplete() {
375 SendAsyncResponse(); 375 SendAsyncResponse();
376 } 376 }
OLDNEW
« no previous file with comments | « chrome/browser/dom_ui/net_internals_ui.cc ('k') | chrome/browser/geolocation/network_location_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698