| 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/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 23 #include "googleurl/src/gurl.h" | 22 #include "googleurl/src/gurl.h" |
| 24 #include "grit/generated_resources.h" | 23 #include "grit/generated_resources.h" |
| 25 #include "net/base/data_url.h" | 24 #include "net/base/data_url.h" |
| 25 #include "sql/statement.h" |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 // A function like this is used by other importers in order to filter out | 29 // A function like this is used by other importers in order to filter out |
| 30 // URLS we don't want to import. | 30 // URLS we don't want to import. |
| 31 // For now it's pretty basic, but I've split it out so it's easy to slot | 31 // For now it's pretty basic, but I've split it out so it's easy to slot |
| 32 // in necessary logic for filtering URLS, should we need it. | 32 // in necessary logic for filtering URLS, should we need it. |
| 33 bool CanImportSafariURL(const GURL& url) { | 33 bool CanImportSafariURL(const GURL& url) { |
| 34 // The URL is not valid. | 34 // The URL is not valid. |
| 35 if (!url.is_valid()) | 35 if (!url.is_valid()) |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 if (!last_visit_str) | 393 if (!last_visit_str) |
| 394 continue; | 394 continue; |
| 395 | 395 |
| 396 // Convert Safari's last visit time to Unix Epoch time. | 396 // Convert Safari's last visit time to Unix Epoch time. |
| 397 double seconds_since_unix_epoch = HistoryTimeToEpochTime(last_visit_str); | 397 double seconds_since_unix_epoch = HistoryTimeToEpochTime(last_visit_str); |
| 398 row.set_last_visit(base::Time::FromDoubleT(seconds_since_unix_epoch)); | 398 row.set_last_visit(base::Time::FromDoubleT(seconds_since_unix_epoch)); |
| 399 | 399 |
| 400 history_items->push_back(row); | 400 history_items->push_back(row); |
| 401 } | 401 } |
| 402 } | 402 } |
| OLD | NEW |