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

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

Issue 325443002: Move about://-related constants from //content to //url (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Android ifx Created 6 years, 6 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
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 22 matching lines...) Expand all
33 return false; 33 return false;
34 34
35 // Filter out the URLs with unsupported schemes. 35 // Filter out the URLs with unsupported schemes.
36 const char* const kInvalidSchemes[] = {"wyciwyg", "place"}; 36 const char* const kInvalidSchemes[] = {"wyciwyg", "place"};
37 for (size_t i = 0; i < arraysize(kInvalidSchemes); ++i) { 37 for (size_t i = 0; i < arraysize(kInvalidSchemes); ++i) {
38 if (url.SchemeIs(kInvalidSchemes[i])) 38 if (url.SchemeIs(kInvalidSchemes[i]))
39 return false; 39 return false;
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(url::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(content::kChromeUIScheme) || 48 if (url.SchemeIs(content::kChromeUIScheme) ||
49 url.SchemeIs(content::kAboutScheme)) { 49 url.SchemeIs(url::kAboutScheme)) {
50 if (url.host() == chrome::kChromeUIUberHost || 50 if (url.host() == chrome::kChromeUIUberHost ||
51 url.host() == chrome::kChromeUIAboutHost) 51 url.host() == chrome::kChromeUIAboutHost)
52 return true; 52 return true;
53 53
54 GURL fixed_url(URLFixerUpper::FixupURL(url.spec(), std::string())); 54 GURL fixed_url(URLFixerUpper::FixupURL(url.spec(), std::string()));
55 for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) { 55 for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) {
56 if (fixed_url.DomainIs(chrome::kChromeHostURLs[i])) 56 if (fixed_url.DomainIs(chrome::kChromeHostURLs[i]))
57 return true; 57 return true;
58 } 58 }
59 59
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 base::string16 first_folder_name = 103 base::string16 first_folder_name =
104 bridge->GetLocalizedString(IDS_BOOKMARK_GROUP); 104 bridge->GetLocalizedString(IDS_BOOKMARK_GROUP);
105 bridge->AddBookmarks(bookmarks, first_folder_name); 105 bridge->AddBookmarks(bookmarks, first_folder_name);
106 } 106 }
107 if (!favicons.empty()) 107 if (!favicons.empty())
108 bridge->SetFavicons(favicons); 108 bridge->SetFavicons(favicons);
109 109
110 bridge->NotifyItemEnded(importer::FAVORITES); 110 bridge->NotifyItemEnded(importer::FAVORITES);
111 bridge->NotifyEnded(); 111 bridge->NotifyEnded();
112 } 112 }
OLDNEW
« no previous file with comments | « chrome/test/ppapi/ppapi_browsertest.cc ('k') | components/bookmarks/browser/bookmark_index_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698