summaryrefslogtreecommitdiffstats
path: root/chrome/browser/protector/default_search_provider_change.cc
diff options
context:
space:
mode:
authorsail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 04:25:45 +0000
committersail@chromium.org <sail@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 04:25:45 +0000
commitc6b207c6c4290a06000fabd9b09a96614d3ae118 (patch)
tree6c3f284de26c7a88415bba43f465e32282700d01 /chrome/browser/protector/default_search_provider_change.cc
parent02eb89fb03a303cb2b745063e6d852feb3bc5c5e (diff)
downloadchromium_src-c6b207c6c4290a06000fabd9b09a96614d3ae118.zip
chromium_src-c6b207c6c4290a06000fabd9b09a96614d3ae118.tar.gz
chromium_src-c6b207c6c4290a06000fabd9b09a96614d3ae118.tar.bz2
Cocoa: Close bubble if its GlobalError object is removed
This is the Cocoa version of this change: https://chromiumcodereview.appspot.com/9190009 BUG=109728 TEST= Review URL: http://codereview.chromium.org/9254019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118994 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/protector/default_search_provider_change.cc')
-rw-r--r--chrome/browser/protector/default_search_provider_change.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/chrome/browser/protector/default_search_provider_change.cc b/chrome/browser/protector/default_search_provider_change.cc
index d7b29a8..6818f49 100644
--- a/chrome/browser/protector/default_search_provider_change.cc
+++ b/chrome/browser/protector/default_search_provider_change.cc
@@ -89,8 +89,8 @@ class DefaultSearchProviderChange : public BaseSettingChange,
// BaseSettingChange overrides:
virtual bool Init(Profile* profile) OVERRIDE;
- virtual void Apply() OVERRIDE;
- virtual void Discard() OVERRIDE;
+ virtual void Apply(Browser* browser) OVERRIDE;
+ virtual void Discard(Browser* browser) OVERRIDE;
virtual void Timeout() OVERRIDE;
virtual int GetBadgeIconID() const OVERRIDE;
virtual int GetMenuItemIconID() const OVERRIDE;
@@ -121,7 +121,7 @@ class DefaultSearchProviderChange : public BaseSettingChange,
scoped_ptr<TemplateURL>* search_provider);
// Opens the Search engine settings page in a new tab.
- void OpenSearchEngineSettings();
+ void OpenSearchEngineSettings(Browser* browser);
// Returns the TemplateURLService instance for the Profile this change is
// related to.
@@ -232,7 +232,7 @@ bool DefaultSearchProviderChange::Init(Profile* profile) {
return true;
}
-void DefaultSearchProviderChange::Apply() {
+void DefaultSearchProviderChange::Apply(Browser* browser) {
UMA_HISTOGRAM_ENUMERATION(
kProtectorHistogramSearchProviderApplied,
new_histogram_id_,
@@ -243,11 +243,11 @@ void DefaultSearchProviderChange::Apply() {
GetTemplateURLService()->SetDefaultSearchProvider(new_search_provider_);
} else {
// Open settings page in case the new setting is invalid.
- OpenSearchEngineSettings();
+ OpenSearchEngineSettings(browser);
}
}
-void DefaultSearchProviderChange::Discard() {
+void DefaultSearchProviderChange::Discard(Browser* browser) {
UMA_HISTOGRAM_ENUMERATION(
kProtectorHistogramSearchProviderDiscarded,
new_histogram_id_,
@@ -256,7 +256,7 @@ void DefaultSearchProviderChange::Discard() {
GetTemplateURLService()->RemoveObserver(this);
if (is_fallback_) {
// Open settings page in case the old setting is invalid.
- OpenSearchEngineSettings();
+ OpenSearchEngineSettings(browser);
}
// Nothing to do otherwise since we have already set the search engine
// to |old_id_| in |Init|.
@@ -385,10 +385,10 @@ const TemplateURL* DefaultSearchProviderChange::SetDefaultSearchProvider(
return new_default_provider;
}
-void DefaultSearchProviderChange::OpenSearchEngineSettings() {
+void DefaultSearchProviderChange::OpenSearchEngineSettings(Browser* browser) {
ProtectorServiceFactory::GetForProfile(profile())->OpenTab(
GURL(std::string(chrome::kChromeUISettingsURL) +
- chrome::kSearchEnginesSubPage));
+ chrome::kSearchEnginesSubPage), browser);
}
TemplateURLService* DefaultSearchProviderChange::GetTemplateURLService() {