summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-28 20:47:44 +0000
committermirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-28 20:47:44 +0000
commit942686d30f1dbec2fde936b59d3866e7ac05931f (patch)
tree36a83cbc0d2d5a267845842dada7d942db11a67b
parent7866477b576d9f7aac4df37d3fb787535c374878 (diff)
downloadchromium_src-942686d30f1dbec2fde936b59d3866e7ac05931f.zip
chromium_src-942686d30f1dbec2fde936b59d3866e7ac05931f.tar.gz
chromium_src-942686d30f1dbec2fde936b59d3866e7ac05931f.tar.bz2
Merge 64298 - If default browser is set to FF, and Chrome is run as first-run with an empty profile, import ignores FF data and imports from Safari instead.
BUG=61112 TEST=see bug. Review URL: http://codereview.chromium.org/4206002 TBR=mirandac@chromium.org Review URL: http://codereview.chromium.org/4190011 git-svn-id: svn://svn.chromium.org/chrome/branches/552/src@64308 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/cocoa/search_engine_dialog_controller.h3
-rw-r--r--chrome/browser/cocoa/search_engine_dialog_controller.mm14
-rw-r--r--chrome/browser/importer/importer_list.cc15
3 files changed, 22 insertions, 10 deletions
diff --git a/chrome/browser/cocoa/search_engine_dialog_controller.h b/chrome/browser/cocoa/search_engine_dialog_controller.h
index a410614..0cc06f2 100644
--- a/chrome/browser/cocoa/search_engine_dialog_controller.h
+++ b/chrome/browser/cocoa/search_engine_dialog_controller.h
@@ -6,6 +6,7 @@
#include <vector>
+#import "base/ref_counted.h"
#import "base/scoped_nsobject.h"
#include "base/scoped_ptr.h"
@@ -27,7 +28,7 @@ class TemplateURLModel;
TemplateURLModel* searchEnginesModel_;
// Bridge to the C++ world.
- scoped_ptr<SearchEngineDialogControllerBridge> bridge_;
+ scoped_refptr<SearchEngineDialogControllerBridge> bridge_;
// Offered search engine choices.
std::vector<const TemplateURL*> choices_;
diff --git a/chrome/browser/cocoa/search_engine_dialog_controller.mm b/chrome/browser/cocoa/search_engine_dialog_controller.mm
index 4863c07..511672b 100644
--- a/chrome/browser/cocoa/search_engine_dialog_controller.mm
+++ b/chrome/browser/cocoa/search_engine_dialog_controller.mm
@@ -40,7 +40,9 @@ const int kLogoLabelHeight = 25;
- (IBAction)searchEngineSelected:(id)sender;
@end
-class SearchEngineDialogControllerBridge : public TemplateURLModelObserver {
+class SearchEngineDialogControllerBridge :
+ public base::RefCounted<SearchEngineDialogControllerBridge>,
+ public TemplateURLModelObserver {
public:
SearchEngineDialogControllerBridge(SearchEngineDialogController* controller);
@@ -71,7 +73,7 @@ void SearchEngineDialogControllerBridge::OnTemplateURLModelChanged() {
ofType:@"nib"];
self = [super initWithWindowNibPath:nibpath owner:self];
if (self != nil) {
- bridge_.reset(new SearchEngineDialogControllerBridge(self));
+ bridge_ = new SearchEngineDialogControllerBridge(self);
}
return self;
}
@@ -85,11 +87,15 @@ void SearchEngineDialogControllerBridge::OnTemplateURLModelChanged() {
searchEnginesModel_->AddObserver(bridge_.get());
if (searchEnginesModel_->loaded()) {
- [self onTemplateURLModelChanged];
+ MessageLoop::current()->PostTask(
+ FROM_HERE,
+ NewRunnableMethod(
+ bridge_.get(),
+ &SearchEngineDialogControllerBridge::OnTemplateURLModelChanged));
} else {
searchEnginesModel_->Load();
- MessageLoop::current()->Run();
}
+ MessageLoop::current()->Run();
}
- (void)onTemplateURLModelChanged {
diff --git a/chrome/browser/importer/importer_list.cc b/chrome/browser/importer/importer_list.cc
index f529284..6ac6517 100644
--- a/chrome/browser/importer/importer_list.cc
+++ b/chrome/browser/importer/importer_list.cc
@@ -35,9 +35,9 @@ ImporterList::~ImporterList() {
}
void ImporterList::DetectSourceProfiles() {
+// The first run import will automatically take settings from the first
+// profile detected, which should be the user's current default.
#if defined(OS_WIN)
- // The order in which detect is called determines the order
- // in which the options appear in the dropdown combo-box
if (ShellIntegration::IsFirefoxDefaultBrowser()) {
DetectFirefoxProfiles();
DetectIEProfiles();
@@ -47,10 +47,15 @@ void ImporterList::DetectSourceProfiles() {
}
// TODO(brg) : Current UI requires win_util.
DetectGoogleToolbarProfiles();
+#elif defined(OS_MACOSX)
+ if (ShellIntegration::IsFirefoxDefaultBrowser()) {
+ DetectFirefoxProfiles();
+ DetectSafariProfiles();
+ } else {
+ DetectSafariProfiles();
+ DetectFirefoxProfiles();
+ }
#else
-#if defined(OS_MACOSX)
- DetectSafariProfiles();
-#endif
DetectFirefoxProfiles();
#endif
}