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 <Cocoa/Cocoa.h> | 5 #include <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "chrome/browser/importer/safari_importer.h" | 7 #include "chrome/browser/importer/safari_importer.h" |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "app/sql/statement.h" | |
13 #include "base/file_util.h" | 12 #include "base/file_util.h" |
14 #include "base/mac/mac_util.h" | 13 #include "base/mac/mac_util.h" |
15 #include "base/memory/scoped_nsobject.h" | 14 #include "base/memory/scoped_nsobject.h" |
16 #include "base/string16.h" | 15 #include "base/string16.h" |
17 #include "base/sys_string_conversions.h" | 16 #include "base/sys_string_conversions.h" |
18 #include "base/time.h" | 17 #include "base/time.h" |
19 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
20 #include "chrome/browser/history/history_types.h" | 19 #include "chrome/browser/history/history_types.h" |
21 #include "chrome/browser/importer/importer_bridge.h" | 20 #include "chrome/browser/importer/importer_bridge.h" |
22 #include "chrome/browser/importer/importer_util.h" | 21 #include "chrome/browser/importer/importer_util.h" |
23 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
24 #include "googleurl/src/gurl.h" | 23 #include "googleurl/src/gurl.h" |
25 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
26 #include "net/base/data_url.h" | 25 #include "net/base/data_url.h" |
| 26 #include "sql/statement.h" |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 // A function like this is used by other importers in order to filter out | 30 // A function like this is used by other importers in order to filter out |
31 // URLS we don't want to import. | 31 // URLS we don't want to import. |
32 // For now it's pretty basic, but I've split it out so it's easy to slot | 32 // For now it's pretty basic, but I've split it out so it's easy to slot |
33 // in necessary logic for filtering URLS, should we need it. | 33 // in necessary logic for filtering URLS, should we need it. |
34 bool CanImportSafariURL(const GURL& url) { | 34 bool CanImportSafariURL(const GURL& url) { |
35 // The URL is not valid. | 35 // The URL is not valid. |
36 if (!url.is_valid()) | 36 if (!url.is_valid()) |
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 if (!last_visit_str) | 394 if (!last_visit_str) |
395 continue; | 395 continue; |
396 | 396 |
397 // Convert Safari's last visit time to Unix Epoch time. | 397 // Convert Safari's last visit time to Unix Epoch time. |
398 double seconds_since_unix_epoch = HistoryTimeToEpochTime(last_visit_str); | 398 double seconds_since_unix_epoch = HistoryTimeToEpochTime(last_visit_str); |
399 row.set_last_visit(base::Time::FromDoubleT(seconds_since_unix_epoch)); | 399 row.set_last_visit(base::Time::FromDoubleT(seconds_since_unix_epoch)); |
400 | 400 |
401 history_items->push_back(row); | 401 history_items->push_back(row); |
402 } | 402 } |
403 } | 403 } |
OLD | NEW |