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

Unified Diff: chrome/browser/extensions/default_apps.cc

Issue 10916041: Reliably install default apps into new installations. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix Android build Created 8 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/default_apps.cc
diff --git a/chrome/browser/extensions/default_apps.cc b/chrome/browser/extensions/default_apps.cc
index bcd35900b7930346ad758fcd64c4b4ae5ad885f7..d0eaef1c33b05d93129f4b5e8ffc909097457c9f 100644
--- a/chrome/browser/extensions/default_apps.cc
+++ b/chrome/browser/extensions/default_apps.cc
@@ -7,7 +7,9 @@
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
#include "chrome/browser/browser_process.h"
+#if !defined(OS_ANDROID)
#include "chrome/browser/first_run/first_run.h"
+#endif
#include "chrome/browser/extensions/default_apps_trial.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -75,10 +77,21 @@ bool Provider::ShouldInstallInProfile() {
switch (state) {
case kUnknown: {
- // This is the first time the default apps feature runs on this profile.
- // Determine if we want to install them or not.
+ // Only new installations and profiles get default apps. In theory the
+ // new profile checks should catch new installations, but that is not
+ // always the case (http:/crbug.com/145351).
chrome::VersionInfo version_info;
- if (!profile_->WasCreatedByVersionOrLater(version_info.Version().c_str()))
+ bool is_new_profile =
+ profile_->WasCreatedByVersionOrLater(version_info.Version().c_str());
+ // Android excludes most of the first run code, so it can't determine
+ // if this is a first run. That's OK though, because Android doesn't
+ // use default apps in general.
+#if defined(OS_ANDROID)
+ bool is_first_run = false;
+#else
+ bool is_first_run = first_run::IsChromeFirstRun();
+#endif
+ if (!is_first_run && !is_new_profile)
install_apps = false;
break;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698