Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7071)

Unified Diff: chrome/browser/ui/startup/default_browser_prompt.cc

Issue 10539169: Prototype version of the first-run dialog for Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Renamed classes and files. Addressed other remarks. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/startup/default_browser_prompt.cc
diff --git a/chrome/browser/ui/startup/default_browser_prompt.cc b/chrome/browser/ui/startup/default_browser_prompt.cc
index b36990a8d8b947a1cf10c69cb42ded6b0397251e..273974cf657a3d305d404438b1ffe4a26474d272 100644
--- a/chrome/browser/ui/startup/default_browser_prompt.cc
+++ b/chrome/browser/ui/startup/default_browser_prompt.cc
@@ -34,11 +34,20 @@ namespace {
// Calls the appropriate function for setting Chrome as the default browser.
// This requires IO access (registry) and may result in interaction with a
// modal system UI.
-void SetChromeAsDefaultBrowser(bool interactive_flow) {
+void SetChromeAsDefaultBrowser(bool interactive_flow, PrefService* prefs) {
if (interactive_flow) {
UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.SetAsDefaultUI", 1);
- if (!ShellIntegration::SetAsDefaultBrowserInteractive())
+ if (!ShellIntegration::SetAsDefaultBrowserInteractive()) {
UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.SetAsDefaultUIFailed", 1);
+ } else if (!ShellIntegration::IsDefaultBrowser()) {
+ // If the interaction succeeded but we are still not the default browser
+ // it likely means the user simply selected another browser from the
+ // panel. We will respect this choice and write it down as 'no, thanks'.
+ UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.DontSetAsDefault", 1);
+ // User clicked "Don't ask me again", remember that.
+ if (prefs)
+ prefs->SetBoolean(prefs::kCheckDefaultBrowser, false);
+ }
} else {
UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.SetAsDefault", 1);
ShellIntegration::SetAsDefaultBrowser();
@@ -134,7 +143,8 @@ bool DefaultBrowserInfoBarDelegate::Accept() {
BrowserThread::PostTask(
BrowserThread::FILE,
FROM_HERE,
- base::Bind(&SetChromeAsDefaultBrowser, interactive_flow_required_));
+ base::Bind(&SetChromeAsDefaultBrowser, interactive_flow_required_,
+ prefs_));
return true;
}
@@ -196,6 +206,11 @@ void ShowDefaultBrowserPrompt(Profile* profile) {
}
+#if !defined(OS_WIN)
+void ShowFirstRunDefaultBrowserPrompt(Profile* profile) {
+}
+#endif
+
namespace internal {
void NotifyNotDefaultBrowserCallback() {

Powered by Google App Engine
This is Rietveld 408576698