OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 } | 46 } |
47 | 47 |
48 void GetVisitInfoDictionary(const history::VisitRow& row, | 48 void GetVisitInfoDictionary(const history::VisitRow& row, |
49 DictionaryValue* value) { | 49 DictionaryValue* value) { |
50 value->SetString(keys::kIdKey, base::Int64ToString(row.url_id)); | 50 value->SetString(keys::kIdKey, base::Int64ToString(row.url_id)); |
51 value->SetString(keys::kVisitId, base::Int64ToString(row.visit_id)); | 51 value->SetString(keys::kVisitId, base::Int64ToString(row.visit_id)); |
52 value->SetDouble(keys::kVisitTime, MilliSecondsFromTime(row.visit_time)); | 52 value->SetDouble(keys::kVisitTime, MilliSecondsFromTime(row.visit_time)); |
53 value->SetString(keys::kReferringVisitId, | 53 value->SetString(keys::kReferringVisitId, |
54 base::Int64ToString(row.referring_visit)); | 54 base::Int64ToString(row.referring_visit)); |
55 | 55 |
56 const char* trans = PageTransition::CoreTransitionString(row.transition); | 56 const char* trans = |
| 57 content::PageTransitionGetCoreTransitionString(row.transition); |
57 DCHECK(trans) << "Invalid transition."; | 58 DCHECK(trans) << "Invalid transition."; |
58 value->SetString(keys::kTransition, trans); | 59 value->SetString(keys::kTransition, trans); |
59 } | 60 } |
60 | 61 |
61 void AddVisitNode(const history::VisitRow& row, ListValue* list) { | 62 void AddVisitNode(const history::VisitRow& row, ListValue* list) { |
62 DictionaryValue* dict = new DictionaryValue(); | 63 DictionaryValue* dict = new DictionaryValue(); |
63 GetVisitInfoDictionary(row, dict); | 64 GetVisitInfoDictionary(row, dict); |
64 list->Append(dict); | 65 list->Append(dict); |
65 } | 66 } |
66 | 67 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 &cancelable_consumer_, | 371 &cancelable_consumer_, |
371 base::Bind(&DeleteAllHistoryFunction::DeleteComplete, | 372 base::Bind(&DeleteAllHistoryFunction::DeleteComplete, |
372 base::Unretained(this))); | 373 base::Unretained(this))); |
373 | 374 |
374 return true; | 375 return true; |
375 } | 376 } |
376 | 377 |
377 void DeleteAllHistoryFunction::DeleteComplete() { | 378 void DeleteAllHistoryFunction::DeleteComplete() { |
378 SendAsyncResponse(); | 379 SendAsyncResponse(); |
379 } | 380 } |
OLD | NEW |