| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/utility/importer/bookmarks_file_importer.h" | 5 #include "chrome/utility/importer/bookmarks_file_importer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 // Check if |url| is about:blank. | 45 // Check if |url| is about:blank. |
| 46 if (url == url::kAboutBlankURL) | 46 if (url == url::kAboutBlankURL) |
| 47 return true; | 47 return true; |
| 48 | 48 |
| 49 // If |url| starts with chrome:// or about:, check if it's one of the URLs | 49 // If |url| starts with chrome:// or about:, check if it's one of the URLs |
| 50 // that we support. | 50 // that we support. |
| 51 if (url.SchemeIs(content::kChromeUIScheme) || | 51 if (url.SchemeIs(content::kChromeUIScheme) || |
| 52 url.SchemeIs(url::kAboutScheme)) { | 52 url.SchemeIs(url::kAboutScheme)) { |
| 53 if (url.host() == chrome::kChromeUIUberHost || | 53 if (url.host_piece() == chrome::kChromeUIUberHost || |
| 54 url.host() == chrome::kChromeUIAboutHost) | 54 url.host_piece() == chrome::kChromeUIAboutHost) |
| 55 return true; | 55 return true; |
| 56 | 56 |
| 57 GURL fixed_url(url_formatter::FixupURL(url.spec(), std::string())); | 57 GURL fixed_url(url_formatter::FixupURL(url.spec(), std::string())); |
| 58 for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) { | 58 for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) { |
| 59 if (fixed_url.DomainIs(chrome::kChromeHostURLs[i])) | 59 if (fixed_url.DomainIs(chrome::kChromeHostURLs[i])) |
| 60 return true; | 60 return true; |
| 61 } | 61 } |
| 62 | 62 |
| 63 for (int i = 0; i < chrome::kNumberOfChromeDebugURLs; ++i) { | 63 for (int i = 0; i < chrome::kNumberOfChromeDebugURLs; ++i) { |
| 64 if (fixed_url == chrome::kChromeDebugURLs[i]) | 64 if (fixed_url == chrome::kChromeDebugURLs[i]) |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 bridge->AddBookmarks(bookmarks, first_folder_name); | 110 bridge->AddBookmarks(bookmarks, first_folder_name); |
| 111 } | 111 } |
| 112 if (!search_engines.empty()) | 112 if (!search_engines.empty()) |
| 113 bridge->SetKeywords(search_engines, false); | 113 bridge->SetKeywords(search_engines, false); |
| 114 if (!favicons.empty()) | 114 if (!favicons.empty()) |
| 115 bridge->SetFavicons(favicons); | 115 bridge->SetFavicons(favicons); |
| 116 | 116 |
| 117 bridge->NotifyItemEnded(importer::FAVORITES); | 117 bridge->NotifyItemEnded(importer::FAVORITES); |
| 118 bridge->NotifyEnded(); | 118 bridge->NotifyEnded(); |
| 119 } | 119 } |
| OLD | NEW |