summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorgab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 19:54:37 +0000
committergab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-24 19:54:37 +0000
commit76a044f0c255dc8d351b00a9711b9e9d62e9045f (patch)
treedb41519a4429c5762d9bca6e24a7cc56f5786b14 /chrome
parent8374d9fd562dd1bbd89dc57c33da1fbb9bcd122e (diff)
downloadchromium_src-76a044f0c255dc8d351b00a9711b9e9d62e9045f.zip
chromium_src-76a044f0c255dc8d351b00a9711b9e9d62e9045f.tar.gz
chromium_src-76a044f0c255dc8d351b00a9711b9e9d62e9045f.tar.bz2
Remove unused |first_run| parameter in ImporterHost::CheckForFirefoxLock() which results in a cascade of unused parameter removal.
This is a precursor CL to https://codereview.chromium.org/12670013/ TBR=ben@chromium.org BUG=219419 Review URL: https://chromiumcodereview.appspot.com/14316007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@196209 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/automation/testing_automation_provider.cc4
-rw-r--r--chrome/browser/automation/testing_automation_provider.h1
-rw-r--r--chrome/browser/extensions/api/bookmarks/bookmarks_api.cc3
-rw-r--r--chrome/browser/first_run/first_run.cc3
-rw-r--r--chrome/browser/first_run/first_run_posix.cc3
-rw-r--r--chrome/browser/first_run/first_run_win.cc2
-rw-r--r--chrome/browser/importer/external_process_importer_host.cc5
-rw-r--r--chrome/browser/importer/external_process_importer_host.h3
-rw-r--r--chrome/browser/importer/firefox_importer_unittest.cc5
-rw-r--r--chrome/browser/importer/ie_importer_unittest_win.cc6
-rw-r--r--chrome/browser/importer/importer_host.cc8
-rw-r--r--chrome/browser/importer/importer_host.h8
-rw-r--r--chrome/browser/ui/webui/options/import_data_handler.cc2
-rwxr-xr-xchrome/test/functional/imports.py43
-rwxr-xr-xchrome/test/pyautolib/pyauto.py10
15 files changed, 28 insertions, 78 deletions
diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc
index 9a45b7c..f2330a5 100644
--- a/chrome/browser/automation/testing_automation_provider.cc
+++ b/chrome/browser/automation/testing_automation_provider.cc
@@ -332,8 +332,7 @@ void TestingAutomationProvider::OnSourceProfilesLoaded() {
importer_host->StartImportSettings(source_profile,
target_profile,
import_settings_data_.import_items,
- new ProfileWriter(target_profile),
- import_settings_data_.first_run);
+ new ProfileWriter(target_profile));
}
void TestingAutomationProvider::Observe(
@@ -3265,7 +3264,6 @@ void TestingAutomationProvider::ImportSettings(Browser* browser,
ListValue* import_items_list = NULL;
if (!args->GetString("import_from", &import_settings_data_.browser_name) ||
- !args->GetBoolean("first_run", &import_settings_data_.first_run) ||
!args->GetList("import_items", &import_items_list)) {
AutomationJSONReply(this, reply_message)
.SendError("Incorrect type for one or more of the arguments.");
diff --git a/chrome/browser/automation/testing_automation_provider.h b/chrome/browser/automation/testing_automation_provider.h
index 3bcbefd..663503d 100644
--- a/chrome/browser/automation/testing_automation_provider.h
+++ b/chrome/browser/automation/testing_automation_provider.h
@@ -69,7 +69,6 @@ class TestingAutomationProvider : public AutomationProvider,
struct ImportSettingsData {
string16 browser_name;
int import_items;
- bool first_run;
Browser* browser;
IPC::Message* reply_message;
};
diff --git a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
index a7a2c74..7415af7 100644
--- a/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
+++ b/chrome/browser/extensions/api/bookmarks/bookmarks_api.cc
@@ -983,8 +983,7 @@ void BookmarksImportFunction::FileSelected(const base::FilePath& path,
importer_host->StartImportSettings(source_profile,
profile(),
importer::FAVORITES,
- new ProfileWriter(profile()),
- true);
+ new ProfileWriter(profile()));
importer::LogImporterUseToMetrics("BookmarksAPI",
importer::TYPE_BOOKMARKS_FILE);
diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc
index 2bf8688..53a8db5 100644
--- a/chrome/browser/first_run/first_run.cc
+++ b/chrome/browser/first_run/first_run.cc
@@ -212,8 +212,7 @@ void ImportFromFile(Profile* profile, const CommandLine& cmdline) {
first_run::internal::ImportEndedObserver observer;
importer_host->SetObserver(&observer);
importer_host->StartImportSettings(
- source_profile, profile, importer::FAVORITES, new ProfileWriter(profile),
- true);
+ source_profile, profile, importer::FAVORITES, new ProfileWriter(profile));
// If the import process has not errored out, block on it.
if (!observer.ended()) {
observer.set_should_quit_message_loop();
diff --git a/chrome/browser/first_run/first_run_posix.cc b/chrome/browser/first_run/first_run_posix.cc
index eb9becc..596cc64 100644
--- a/chrome/browser/first_run/first_run_posix.cc
+++ b/chrome/browser/first_run/first_run_posix.cc
@@ -63,8 +63,7 @@ bool ImportSettings(Profile* profile,
importer_host->StartImportSettings(source_profile,
profile,
items_to_import,
- new ProfileWriter(profile),
- true);
+ new ProfileWriter(profile));
// If the import process has not errored out, block on it.
if (!observer.ended()) {
observer.set_should_quit_message_loop();
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index 7628e25..8a5a9a5 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -310,7 +310,7 @@ int ImportFromBrowser(Profile* profile,
importer_host->SetObserver(&observer);
importer_host->StartImportSettings(
importer_list->GetSourceProfileForImporterType(importer_type), profile,
- static_cast<uint16>(items_to_import), new ProfileWriter(profile), true);
+ static_cast<uint16>(items_to_import), new ProfileWriter(profile));
// If the import process has not errored out, block on it.
if (!observer.ended()) {
observer.set_should_quit_message_loop();
diff --git a/chrome/browser/importer/external_process_importer_host.cc b/chrome/browser/importer/external_process_importer_host.cc
index 6584a1a..0d3acfe 100644
--- a/chrome/browser/importer/external_process_importer_host.cc
+++ b/chrome/browser/importer/external_process_importer_host.cc
@@ -30,8 +30,7 @@ void ExternalProcessImporterHost::StartImportSettings(
const importer::SourceProfile& source_profile,
Profile* target_profile,
uint16 items,
- ProfileWriter* writer,
- bool first_run) {
+ ProfileWriter* writer) {
// We really only support importing from one host at a time.
DCHECK(!profile_);
DCHECK(target_profile);
@@ -43,7 +42,7 @@ void ExternalProcessImporterHost::StartImportSettings(
ImporterHost::AddRef(); // Balanced in ImporterHost::NotifyImportEnded.
- CheckForFirefoxLock(source_profile, items, first_run);
+ CheckForFirefoxLock(source_profile, items);
CheckForLoadedModels(items);
InvokeTaskIfDone();
diff --git a/chrome/browser/importer/external_process_importer_host.h b/chrome/browser/importer/external_process_importer_host.h
index 9dfe20c..1f1c3d6 100644
--- a/chrome/browser/importer/external_process_importer_host.h
+++ b/chrome/browser/importer/external_process_importer_host.h
@@ -35,8 +35,7 @@ class ExternalProcessImporterHost : public ImporterHost {
const importer::SourceProfile& source_profile,
Profile* target_profile,
uint16 items,
- ProfileWriter* writer,
- bool first_run) OVERRIDE;
+ ProfileWriter* writer) OVERRIDE;
virtual void InvokeTaskIfDone() OVERRIDE;
virtual void Loaded(BookmarkModel* model, bool ids_reassigned) OVERRIDE;
diff --git a/chrome/browser/importer/firefox_importer_unittest.cc b/chrome/browser/importer/firefox_importer_unittest.cc
index 8c8b9fa..b021871 100644
--- a/chrome/browser/importer/firefox_importer_unittest.cc
+++ b/chrome/browser/importer/firefox_importer_unittest.cc
@@ -428,7 +428,7 @@ class FirefoxProfileImporterTest : public ImporterTest {
items = items | importer::SEARCH_ENGINES;
loop->PostTask(FROM_HERE, base::Bind(
&ImporterHost::StartImportSettings, host.get(), source_profile,
- profile_.get(), items, make_scoped_refptr(writer), true));
+ profile_.get(), items, make_scoped_refptr(writer)));
loop->Run();
}
@@ -473,8 +473,7 @@ TEST_F(FirefoxProfileImporterTest, MAYBE_IMPORTER(Firefox2Importer)) {
profile_.get(),
importer::HISTORY | importer::PASSWORDS |
importer::FAVORITES | importer::SEARCH_ENGINES,
- make_scoped_refptr(observer),
- true));
+ make_scoped_refptr(observer)));
loop->Run();
}
diff --git a/chrome/browser/importer/ie_importer_unittest_win.cc b/chrome/browser/importer/ie_importer_unittest_win.cc
index fe752e2..85b915b 100644
--- a/chrome/browser/importer/ie_importer_unittest_win.cc
+++ b/chrome/browser/importer/ie_importer_unittest_win.cc
@@ -520,8 +520,7 @@ TEST_F(IEImporterTest, IEImporter) {
source_profile,
profile_.get(),
importer::HISTORY | importer::PASSWORDS | importer::FAVORITES,
- observer,
- true));
+ observer));
loop->Run();
// Cleans up.
@@ -599,8 +598,7 @@ TEST_F(IEImporterTest, IEImporterMalformedFavoritesRegistry) {
source_profile,
profile_.get(),
importer::FAVORITES,
- observer,
- true));
+ observer));
loop->Run();
}
}
diff --git a/chrome/browser/importer/importer_host.cc b/chrome/browser/importer/importer_host.cc
index f1cbca9..b500571 100644
--- a/chrome/browser/importer/importer_host.cc
+++ b/chrome/browser/importer/importer_host.cc
@@ -107,8 +107,7 @@ void ImporterHost::StartImportSettings(
const importer::SourceProfile& source_profile,
Profile* target_profile,
uint16 items,
- ProfileWriter* writer,
- bool first_run) {
+ ProfileWriter* writer) {
// We really only support importing from one host at a time.
DCHECK(!profile_);
DCHECK(target_profile);
@@ -144,7 +143,7 @@ void ImporterHost::StartImportSettings(
task_ = base::Bind(
&Importer::StartImport, importer_, source_profile, items, bridge);
- CheckForFirefoxLock(source_profile, items, first_run);
+ CheckForFirefoxLock(source_profile, items);
#if defined(OS_WIN)
// For google toolbar import, we need the user to log in and store their GAIA
@@ -202,8 +201,7 @@ ImporterHost::~ImporterHost() {
void ImporterHost::CheckForFirefoxLock(
const importer::SourceProfile& source_profile,
- uint16 items,
- bool first_run) {
+ uint16 items) {
if (source_profile.importer_type == importer::TYPE_FIREFOX2 ||
source_profile.importer_type == importer::TYPE_FIREFOX3) {
DCHECK(!firefox_lock_.get());
diff --git a/chrome/browser/importer/importer_host.h b/chrome/browser/importer/importer_host.h
index ab90d7c..27bcbfd 100644
--- a/chrome/browser/importer/importer_host.h
+++ b/chrome/browser/importer/importer_host.h
@@ -74,13 +74,11 @@ class ImporterHost : public base::RefCountedThreadSafe<ImporterHost>,
// |target_profile| - profile to import into.
// |items| - specifies which data to import (bitmask of importer::ImportItem).
// |writer| - called to actually write data back to the profile.
- // |first_run| - true if this method is being called during first run.
virtual void StartImportSettings(
const importer::SourceProfile& source_profile,
Profile* target_profile,
uint16 items,
- ProfileWriter* writer,
- bool first_run);
+ ProfileWriter* writer);
// Cancels the import process.
virtual void Cancel();
@@ -93,10 +91,8 @@ class ImporterHost : public base::RefCountedThreadSafe<ImporterHost>,
// prior to continue.
// |source_profile| - importer profile to import.
// |items| - specifies which data to import (bitmask of importer::ImportItem).
- // |first_run| - true if this method is being called during first run.
void CheckForFirefoxLock(const importer::SourceProfile& source_profile,
- uint16 items,
- bool first_run);
+ uint16 items);
// Make sure BookmarkModel and TemplateURLService are loaded before import
// process starts, if bookmarks and/or search engines are among the items
diff --git a/chrome/browser/ui/webui/options/import_data_handler.cc b/chrome/browser/ui/webui/options/import_data_handler.cc
index 9d485bc..5b2d449 100644
--- a/chrome/browser/ui/webui/options/import_data_handler.cc
+++ b/chrome/browser/ui/webui/options/import_data_handler.cc
@@ -124,7 +124,7 @@ void ImportDataHandler::ImportData(const ListValue* args) {
Profile* profile = Profile::FromWebUI(web_ui());
importer_host_->StartImportSettings(source_profile, profile,
import_services,
- new ProfileWriter(profile), false);
+ new ProfileWriter(profile));
importer::LogImporterUseToMetrics("ImportDataHandler",
source_profile.importer_type);
diff --git a/chrome/test/functional/imports.py b/chrome/test/functional/imports.py
index 5cd101a..443deec 100755
--- a/chrome/test/functional/imports.py
+++ b/chrome/test/functional/imports.py
@@ -201,7 +201,7 @@ class ImportsTest(pyauto.PyUITest):
logging.warn('Not running firefox import tests.')
return
self._SwapFirefoxProfile()
- self.ImportSettings('Mozilla Firefox', False, self._to_import, window_index)
+ self.ImportSettings('Mozilla Firefox', self._to_import, window_index)
self._CheckDefaults(bookmarks, history, passwords, home_page,
search_engines, window_index)
@@ -231,25 +231,10 @@ class ImportsTest(pyauto.PyUITest):
if self.IsWinVista(): # Broken on vista. crbug.com/89768
return
self._SwapFirefoxProfile()
- self.ImportSettings('Mozilla Firefox', False, self._to_import)
+ self.ImportSettings('Mozilla Firefox', self._to_import)
self._CheckDefaults(bookmarks=True, history=True, passwords=True,
home_page=False, search_engines=True)
- def testFirefoxFirstRun(self):
- """Verify importing from Firefox on the first run.
-
- For Win, only history and homepage will only be imported.
- Mac and Linux can import history, homepage, and bookmarks.
- """
- if not self._CanRunFirefoxTests():
- logging.warn('Not running firefox import tests.')
- return
- self._SwapFirefoxProfile()
- self.ImportSettings('Mozilla Firefox', True, self._to_import)
- non_win = not self.IsWin()
- self._CheckDefaults(bookmarks=non_win, history=True, passwords=True,
- home_page=non_win, search_engines=True)
-
def testImportFirefoxDataTwice(self):
"""Verify importing Firefox data twice.
@@ -261,12 +246,12 @@ class ImportsTest(pyauto.PyUITest):
if self.IsWinVista(): # Broken on vista. crbug.com/89768
return
self._SwapFirefoxProfile()
- self.ImportSettings('Mozilla Firefox', False, self._to_import)
+ self.ImportSettings('Mozilla Firefox', self._to_import)
num_history_orig = len(self.GetHistoryInfo().History())
num_passwords_orig = len(self.GetSavedPasswords())
# Re-import and check for duplicates.
- self.ImportSettings('Mozilla Firefox', False, self._to_import)
+ self.ImportSettings('Mozilla Firefox', self._to_import)
self.assertTrue(self._BookmarkDuplicatesExist(
self._bookmark_bar_items + self._bookmark_folder_items))
self.assertEqual(num_history_orig, len(self.GetHistoryInfo().History()))
@@ -302,8 +287,8 @@ class ImportsTest(pyauto.PyUITest):
self._SwapSafariProfile()
self._SwapFirefoxProfile()
- self.ImportSettings('Mozilla Firefox', False, self._to_import)
- self.ImportSettings('Safari', False, self._to_import)
+ self.ImportSettings('Mozilla Firefox', self._to_import)
+ self.ImportSettings('Safari', self._to_import)
self._CheckDefaults(bookmarks=True, history=True, passwords=True,
home_page=False, search_engines=True)
@@ -316,20 +301,10 @@ class ImportsTest(pyauto.PyUITest):
if not self.IsMac():
return
self._SwapSafariProfile()
- self.ImportSettings('Safari', False, self._to_import)
+ self.ImportSettings('Safari', self._to_import)
self._CheckDefaults(bookmarks=True, history=True, passwords=False,
home_page=False, search_engines=True)
- def testSafariFirstRun(self):
- """Verify importing Safari data on the first run."""
- # This test is Mac only.
- if not self.IsMac():
- return
- self._SwapSafariProfile()
- self.ImportSettings('Safari', False, self._to_import)
- self._CheckDefaults(bookmarks=True, history=True, passwords=False,
- home_page=False, search_engines=False)
-
def testImportSafariDataTwice(self):
"""Verify importing Safari data twice.
@@ -338,12 +313,12 @@ class ImportsTest(pyauto.PyUITest):
if not self.IsMac():
return
self._SwapSafariProfile()
- self.ImportSettings('Safari', False, self._to_import)
+ self.ImportSettings('Safari', self._to_import)
num_history_orig = len(self.GetHistoryInfo().History())
num_passwords_orig = len(self.GetSavedPasswords())
# Re-import and check for duplicates.
- self.ImportSettings('Safari', False, self._to_import)
+ self.ImportSettings('Safari', self._to_import)
self.assertTrue(self._BookmarkDuplicatesExist(
self._bookmark_bar_items + self._bookmark_folder_items))
self.assertEqual(num_history_orig, len(self.GetHistoryInfo().History()))
diff --git a/chrome/test/pyautolib/pyauto.py b/chrome/test/pyautolib/pyauto.py
index 32282a9..984c7a6 100755
--- a/chrome/test/pyautolib/pyauto.py
+++ b/chrome/test/pyautolib/pyauto.py
@@ -2992,8 +2992,7 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
finally:
shutil.rmtree(tempdir, ignore_errors=True)
- def ImportSettings(self, import_from, first_run,
- import_items, windex=0):
+ def ImportSettings(self, import_from, import_items, windex=0):
"""Import the specified import items from the specified browser.
Implements the features available in the "Import Settings" part of the
@@ -3004,12 +3003,6 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
strings (depending on which browsers are installed on the
machine) are: 'Mozilla Firefox', 'Google Toolbar',
'Microsoft Internet Explorer', 'Safari'
- first_run: A boolean indicating whether this is the first run of
- the browser.
- If it is not the first run then:
- 1) Bookmarks are only imported to the bookmarks bar if there
- aren't already bookmarks.
- 2) The bookmark bar is shown.
import_items: A list of strings indicating which items to import.
Strings that can be in the list are:
HISTORY, FAVORITES, PASSWORDS, SEARCH_ENGINES, HOME_PAGE,
@@ -3022,7 +3015,6 @@ class PyUITest(pyautolib.PyUITestBase, unittest.TestCase):
cmd_dict = { # Prepare command for the json interface
'command': 'ImportSettings',
'import_from': import_from,
- 'first_run': first_run,
'import_items': import_items
}
return self._GetResultFromJSONRequest(cmd_dict, windex=windex)