From 5e1bf5d1b59769cb09b36815c184a1bc5802bb36 Mon Sep 17 00:00:00 2001 From: "jcivelli@chromium.org" Date: Wed, 26 May 2010 20:52:18 +0000 Subject: Enabling default apps in officials ChromeOS builds so that the app launcher is not empty. BUG=None TEST=Start an official ChromeOS build, open the NTP. GMail, Calendar and Docs should be available as apps. Review URL: http://codereview.chromium.org/2237003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48321 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/profile.cc | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index eeeee11..2f46701 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -166,6 +166,18 @@ void PostExtensionUnloadedToContextGetter(ChromeURLRequestContextGetter* getter, extension->id())); } +// Returns true if the default apps should be loaded (so that the app panel is +// not empty). +bool IncludeDefaultApps() { +#if defined(OS_WIN) + std::string user_domain; + return base::EnvVarGetter::Create()->GetEnv("USERDOMAIN", &user_domain) && + user_domain == "GOOGLE"; +#elif defined(OS_CHROMEOS) && defined(GOOGLE_CHROME_BUILD) + return true; +#endif + return false; +} } // namespace // A pointer to the request context for the default profile. See comments on @@ -766,16 +778,10 @@ void ProfileImpl::InitExtensions() { // Some sample apps to make our lives easier while we are developing extension // apps. This way we don't have to constantly install these over and over. - if (Extension::AppsAreEnabled()) { -#if defined(OS_WIN) - std::string user_domain; - if (base::EnvVarGetter::Create()->GetEnv("USERDOMAIN", &user_domain) && - user_domain == "GOOGLE") { - component_extensions["gmail_app"] = IDR_GMAIL_APP_MANIFEST; - component_extensions["calendar_app"] = IDR_CALENDAR_APP_MANIFEST; - component_extensions["docs_app"] = IDR_DOCS_APP_MANIFEST; - } -#endif + if (Extension::AppsAreEnabled() && IncludeDefaultApps()) { + component_extensions["gmail_app"] = IDR_GMAIL_APP_MANIFEST; + component_extensions["calendar_app"] = IDR_CALENDAR_APP_MANIFEST; + component_extensions["docs_app"] = IDR_DOCS_APP_MANIFEST; } for (std::map::iterator iter = component_extensions.begin(); -- cgit v1.1