summaryrefslogtreecommitdiffstats
path: root/chrome/browser/importer/importer_host.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-10 21:30:57 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-10 21:30:57 +0000
commitd665ac67340799717388aa496996c65283bd388e (patch)
tree7e5fade162ac44806f81e658f42cdecae364c9c3 /chrome/browser/importer/importer_host.cc
parent07aa98646a9a57f4e5f5fdbf9012b34d0936492f (diff)
downloadchromium_src-d665ac67340799717388aa496996c65283bd388e.zip
chromium_src-d665ac67340799717388aa496996c65283bd388e.tar.gz
chromium_src-d665ac67340799717388aa496996c65283bd388e.tar.bz2
importer: Cleanup ImporterHost class even more.
- Trim the list of includes (remove some crazy and unnecessary includes). - Rename OnLockViewEnd to OnImportLockDialogEnd so it's more clearer what it means. - Move ImporterHost dtor down so it matches with the order in the header file. BUG=None TEST=None Review URL: http://codereview.chromium.org/6669001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@77698 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer/importer_host.cc')
-rw-r--r--chrome/browser/importer/importer_host.cc39
1 files changed, 16 insertions, 23 deletions
diff --git a/chrome/browser/importer/importer_host.cc b/chrome/browser/importer/importer_host.cc
index 8f97140..7d2dc5e 100644
--- a/chrome/browser/importer/importer_host.cc
+++ b/chrome/browser/importer/importer_host.cc
@@ -4,32 +4,25 @@
#include "chrome/browser/importer/importer_host.h"
-#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
-#include "base/values.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/importer/firefox_profile_lock.h"
#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/browser/importer/importer_progress_observer.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_model.h"
-#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/ui/browser_dialogs.h"
-#include "chrome/browser/ui/browser_navigator.h"
-#include "chrome/browser/webdata/web_data_service.h"
#include "content/browser/browser_thread.h"
-#include "content/browser/browsing_instance.h"
-#include "content/browser/site_instance.h"
#include "content/common/notification_source.h"
#include "grit/generated_resources.h"
#include "ui/base/l10n/l10n_util.h"
-// TODO(port): Port these files.
#if defined(OS_WIN)
+// TODO(port): Port this file.
#include "ui/base/message_box_win.h"
-#include "views/window/window.h"
#endif
ImporterHost::ImporterHost()
@@ -44,26 +37,15 @@ ImporterHost::ImporterHost()
observer_(NULL) {
}
-ImporterHost::~ImporterHost() {
- if (NULL != importer_)
- importer_->Release();
-
- if (installed_bookmark_observer_) {
- DCHECK(profile_); // Only way for waiting_for_bookmarkbar_model_ to be true
- // is if we have a profile.
- profile_->GetBookmarkModel()->RemoveObserver(this);
- }
-}
-
void ImporterHost::ShowWarningDialog() {
if (headless_) {
- OnLockViewEnd(false);
+ OnImportLockDialogEnd(false);
} else {
browser::ShowImportLockDialog(parent_window_, this);
}
}
-void ImporterHost::OnLockViewEnd(bool is_continue) {
+void ImporterHost::OnImportLockDialogEnd(bool is_continue) {
if (is_continue) {
// User chose to continue, then we check the lock again to make
// sure that Firefox has been closed. Try to import the settings
@@ -133,7 +115,7 @@ void ImporterHost::StartImportSettings(
url, PageTransition::TYPED);
MessageLoop::current()->PostTask(FROM_HERE, NewRunnableMethod(
- this, &ImporterHost::OnLockViewEnd, false));
+ this, &ImporterHost::OnImportLockDialogEnd, false));
is_source_readable_ = false;
}
@@ -176,6 +158,17 @@ void ImporterHost::NotifyImportEnded() {
Release();
}
+ImporterHost::~ImporterHost() {
+ if (NULL != importer_)
+ importer_->Release();
+
+ if (installed_bookmark_observer_) {
+ DCHECK(profile_); // Only way for waiting_for_bookmarkbar_model_ to be true
+ // is if we have a profile.
+ profile_->GetBookmarkModel()->RemoveObserver(this);
+ }
+}
+
void ImporterHost::InvokeTaskIfDone() {
if (waiting_for_bookmarkbar_model_ || !registrar_.IsEmpty() ||
!is_source_readable_)