Index: chrome/browser/ui/webui/set_as_default_browser_ui.cc |
diff --git a/chrome/browser/ui/webui/set_as_default_browser_ui.cc b/chrome/browser/ui/webui/set_as_default_browser_ui.cc |
index 57f514306cdd95fd3a3f0c1f606c460943a15097..e1a13ebc05e51aec4e03bedbd840f34e549004ff 100644 |
--- a/chrome/browser/ui/webui/set_as_default_browser_ui.cc |
+++ b/chrome/browser/ui/webui/set_as_default_browser_ui.cc |
@@ -135,10 +135,15 @@ void SetAsDefaultBrowserHandler::SetDefaultWebClientUIState( |
// chrome the default. We fold this UI and move on. |
ConcludeInteraction(); |
} else if (state == ShellIntegration::STATE_IS_DEFAULT) { |
- BrowserThread::PostTask( |
- BrowserThread::FILE, FROM_HERE, |
- base::Bind(&SetAsDefaultBrowserHandler::ActivateMetroChrome, |
- base::Unretained(this))); |
+ if (!Profile::FromWebUI(web_ui())->GetPrefs()->GetBoolean( |
gab
2012/07/24 17:43:16
Remove '!' after applying suggested changes in bro
motek.
2012/07/25 10:08:58
As pointed out there, I'd rather keep it.
|
+ prefs::kSuppressSwitchToMetroModeOnSetDefault)) { |
+ BrowserThread::PostTask( |
+ BrowserThread::FILE, FROM_HERE, |
+ base::Bind(&SetAsDefaultBrowserHandler::ActivateMetroChrome, |
+ base::Unretained(this))); |
+ } else { |
+ ConcludeInteraction(); |
+ } |
} |
} |
@@ -167,20 +172,13 @@ void SetAsDefaultBrowserHandler::ConcludeInteraction() { |
WebContents* contents = web_ui()->GetWebContents(); |
if (contents) { |
content::WebContentsDelegate* delegate = contents->GetDelegate(); |
- if (delegate) { |
- if (!delegate->IsPopupOrPanel(contents)) { |
gab
2012/07/24 17:43:16
Just to make sure, we are removing this code to pr
motek.
2012/07/25 10:08:58
We are removing this code because !delegate->IsPop
|
- Browser* browser = browser::FindBrowserWithWebContents(contents); |
- if (browser) |
- chrome::ShowSyncSetup(browser, SyncPromoUI::SOURCE_START_PAGE); |
- } |
+ if (delegate) |
delegate->CloseContents(contents); |
- } |
} |
} |
void SetAsDefaultBrowserHandler::ActivateMetroChrome() { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
- |
FilePath cur_chrome_exe; |
bool sentinel_removed = false; |
if (PathService::Get(base::FILE_EXE, &cur_chrome_exe) && |
@@ -313,19 +311,9 @@ SetAsDefaultBrowserUI::SetAsDefaultBrowserUI(content::WebUI* web_ui) |
} |
// static |
-void SetAsDefaultBrowserUI::Show(Profile* profile, |
- Browser* browser, |
- bool dialog) { |
+void SetAsDefaultBrowserUI::Show(Profile* profile, Browser* browser) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- if (dialog) { |
- SetAsDefaultBrowserDialogImpl* dialog = |
- new SetAsDefaultBrowserDialogImpl(profile, browser); |
- dialog->ShowDialog(); |
- } else { |
- GURL url(chrome::kChromeUIMetroFlowURL); |
- chrome::NavigateParams params( |
- chrome::GetSingletonTabNavigateParams(browser, url)); |
- params.path_behavior = chrome::NavigateParams::IGNORE_AND_NAVIGATE; |
- chrome::ShowSingletonTabOverwritingNTP(browser, params); |
- } |
+ SetAsDefaultBrowserDialogImpl* dialog = |
+ new SetAsDefaultBrowserDialogImpl(profile, browser); |
gab
2012/07/24 17:43:16
Use scoped_ptr, otherwise you are leaking this obj
motek.
2012/07/25 10:08:58
I don't think I am leaking it. This instance is ne
gab
2012/07/25 16:39:55
Ah ok I see, my bad, thanks for clarifying.
|
+ dialog->ShowDialog(); |
} |