OLD | NEW |
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* ***** BEGIN LICENSE BLOCK ***** | 2 /* ***** BEGIN LICENSE BLOCK ***** |
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
4 * | 4 * |
5 * The contents of this file are subject to the Mozilla Public License Version | 5 * The contents of this file are subject to the Mozilla Public License Version |
6 * 1.1 (the "License"); you may not use this file except in compliance with | 6 * 1.1 (the "License"); you may not use this file except in compliance with |
7 * the License. You may obtain a copy of the License at | 7 * the License. You may obtain a copy of the License at |
8 * http://www.mozilla.org/MPL/ | 8 * http://www.mozilla.org/MPL/ |
9 * | 9 * |
10 * Software distributed under the License is distributed on an "AS IS" basis, | 10 * Software distributed under the License is distributed on an "AS IS" basis, |
(...skipping 22 matching lines...) Expand all Loading... |
33 * and other provisions required by the GPL or the LGPL. If you do not delete | 33 * and other provisions required by the GPL or the LGPL. If you do not delete |
34 * the provisions above, a recipient may use your version of this file under | 34 * the provisions above, a recipient may use your version of this file under |
35 * the terms of any one of the MPL, the GPL or the LGPL. | 35 * the terms of any one of the MPL, the GPL or the LGPL. |
36 * | 36 * |
37 * ***** END LICENSE BLOCK ***** */ | 37 * ***** END LICENSE BLOCK ***** */ |
38 | 38 |
39 // Source: | 39 // Source: |
40 // http://mxr.mozilla.org/firefox/source/db/morkreader/nsMorkReader.cpp | 40 // http://mxr.mozilla.org/firefox/source/db/morkreader/nsMorkReader.cpp |
41 // This file has been converted to google style. | 41 // This file has been converted to google style. |
42 | 42 |
43 #include "chrome/browser/mork_reader.h" | 43 #include "chrome/browser/importer/mork_reader.h" |
44 | 44 |
45 #include <algorithm> | 45 #include <algorithm> |
46 | 46 |
47 #include "base/logging.h" | 47 #include "base/logging.h" |
48 #include "base/string_util.h" | 48 #include "base/string_util.h" |
49 #include "chrome/browser/firefox_importer_utils.h" | |
50 #include "chrome/browser/history/history_types.h" | 49 #include "chrome/browser/history/history_types.h" |
| 50 #include "chrome/browser/importer/firefox_importer_utils.h" |
51 | 51 |
52 namespace { | 52 namespace { |
53 | 53 |
54 // Convert a hex character (0-9, A-F) to its corresponding byte value. | 54 // Convert a hex character (0-9, A-F) to its corresponding byte value. |
55 // Returns -1 if the character is invalid. | 55 // Returns -1 if the character is invalid. |
56 inline int HexCharToInt(char c) { | 56 inline int HexCharToInt(char c) { |
57 if ('0' <= c && c <= '9') | 57 if ('0' <= c && c <= '9') |
58 return c - '0'; | 58 return c - '0'; |
59 if ('A' <= c && c <= 'F') | 59 if ('A' <= c && c <= 'F') |
60 return c - 'A' + 10; | 60 return c - 'A' + 10; |
(...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 } | 572 } |
573 } | 573 } |
574 | 574 |
575 std::vector<history::URLRow> rows; | 575 std::vector<history::URLRow> rows; |
576 for (MorkReader::iterator i = reader.begin(); i != reader.end(); ++i) | 576 for (MorkReader::iterator i = reader.begin(); i != reader.end(); ++i) |
577 AddToHistory(i->second, data, &rows); | 577 AddToHistory(i->second, data, &rows); |
578 if (!rows.empty()) | 578 if (!rows.empty()) |
579 loop->PostTask(FROM_HERE, NewRunnableMethod(writer, | 579 loop->PostTask(FROM_HERE, NewRunnableMethod(writer, |
580 &ProfileWriter::AddHistoryPage, rows)); | 580 &ProfileWriter::AddHistoryPage, rows)); |
581 } | 581 } |
OLD | NEW |