Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(222)

Side by Side Diff: chrome/utility/importer/bookmarks_file_importer.cc

Issue 23449036: importer: Allow user to import some missing URLS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/utility/importer/bookmarks_file_importer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/common/importer/imported_bookmark_entry.h" 8 #include "chrome/common/importer/imported_bookmark_entry.h"
9 #include "chrome/common/importer/imported_favicon_usage.h" 9 #include "chrome/common/importer/imported_favicon_usage.h"
10 #include "chrome/common/importer/importer_bridge.h" 10 #include "chrome/common/importer/importer_bridge.h"
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 // Check if |url| is about:blank. 42 // Check if |url| is about:blank.
43 if (url == GURL(content::kAboutBlankURL)) 43 if (url == GURL(content::kAboutBlankURL))
44 return true; 44 return true;
45 45
46 // If |url| starts with chrome:// or about:, check if it's one of the URLs 46 // If |url| starts with chrome:// or about:, check if it's one of the URLs
47 // that we support. 47 // that we support.
48 if (url.SchemeIs(chrome::kChromeUIScheme) || 48 if (url.SchemeIs(chrome::kChromeUIScheme) ||
49 url.SchemeIs(chrome::kAboutScheme)) { 49 url.SchemeIs(chrome::kAboutScheme)) {
50 if (url.host() == chrome::kChromeUIUberHost ||
51 url.host() == chrome::kChromeUIAboutHost)
52 return true;
53
50 GURL fixed_url(URLFixerUpper::FixupURL(url.spec(), std::string())); 54 GURL fixed_url(URLFixerUpper::FixupURL(url.spec(), std::string()));
51 for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) { 55 for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) {
52 if (fixed_url.DomainIs(chrome::kChromeHostURLs[i])) 56 if (fixed_url.DomainIs(chrome::kChromeHostURLs[i]))
53 return true; 57 return true;
54 } 58 }
55 59
56 for (int i = 0; i < chrome::kNumberOfChromeDebugURLs; ++i) { 60 for (int i = 0; i < chrome::kNumberOfChromeDebugURLs; ++i) {
57 if (fixed_url == GURL(chrome::kChromeDebugURLs[i])) 61 if (fixed_url == GURL(chrome::kChromeDebugURLs[i]))
58 return true; 62 return true;
59 } 63 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 base::string16 first_folder_name = 103 base::string16 first_folder_name =
100 bridge->GetLocalizedString(IDS_BOOKMARK_GROUP); 104 bridge->GetLocalizedString(IDS_BOOKMARK_GROUP);
101 bridge->AddBookmarks(bookmarks, first_folder_name); 105 bridge->AddBookmarks(bookmarks, first_folder_name);
102 } 106 }
103 if (!favicons.empty()) 107 if (!favicons.empty())
104 bridge->SetFavicons(favicons); 108 bridge->SetFavicons(favicons);
105 109
106 bridge->NotifyItemEnded(importer::FAVORITES); 110 bridge->NotifyItemEnded(importer::FAVORITES);
107 bridge->NotifyEnded(); 111 bridge->NotifyEnded();
108 } 112 }
OLDNEW
« no previous file with comments | « no previous file | chrome/utility/importer/bookmarks_file_importer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698