Commit d3029578 authored by tfarina@chromium.org's avatar tfarina@chromium.org

importer: Allow user to import some missing URLS.

More specifically, we were not allowing the user to import chrome://chrome
and chrome://about. We add the necessary checks and now the user can import
those urls too.

BUG=283715
TEST=launch chrome, go to bookmarks manager, select "Import Bookmarks from HTML
file", choose an html file that contains either chrome://chrome or chrome://about
or both, verify that now we can import those.
R=isherman@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23449036

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@223432 0039d316-1c4b-4281-b951-d872f2087c98
parent bef0048e
...@@ -47,6 +47,10 @@ bool CanImportURL(const GURL& url) { ...@@ -47,6 +47,10 @@ bool CanImportURL(const GURL& url) {
// that we support. // that we support.
if (url.SchemeIs(chrome::kChromeUIScheme) || if (url.SchemeIs(chrome::kChromeUIScheme) ||
url.SchemeIs(chrome::kAboutScheme)) { url.SchemeIs(chrome::kAboutScheme)) {
if (url.host() == chrome::kChromeUIUberHost ||
url.host() == chrome::kChromeUIAboutHost)
return true;
GURL fixed_url(URLFixerUpper::FixupURL(url.spec(), std::string())); GURL fixed_url(URLFixerUpper::FixupURL(url.spec(), std::string()));
for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) { for (size_t i = 0; i < chrome::kNumberOfChromeHostURLs; ++i) {
if (fixed_url.DomainIs(chrome::kChromeHostURLs[i])) if (fixed_url.DomainIs(chrome::kChromeHostURLs[i]))
......
...@@ -25,6 +25,8 @@ TEST(BookmarksFileImporterTest, CanImportURL) { ...@@ -25,6 +25,8 @@ TEST(BookmarksFileImporterTest, CanImportURL) {
{ "chrome://version", true }, { "chrome://version", true },
{ "chrome://chrome-urls", true }, { "chrome://chrome-urls", true },
{ "chrome://kill", true }, { "chrome://kill", true },
{ "chrome://chrome", true },
{ "chrome://about", true },
{ "about:version", true }, { "about:version", true },
{ "about:blank", true }, { "about:blank", true },
{ "about:credits", true }, { "about:credits", true },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment