summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile.cc
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 17:24:22 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-23 17:24:22 +0000
commitfee679820e1d129068a22e0576b26de53e675673 (patch)
treeefd23477a0d0a329041b032c6e47d3926de99341 /chrome/browser/profile.cc
parent7511d4c0964f65715e18019ae1614c3c53275548 (diff)
downloadchromium_src-fee679820e1d129068a22e0576b26de53e675673.zip
chromium_src-fee679820e1d129068a22e0576b26de53e675673.tar.gz
chromium_src-fee679820e1d129068a22e0576b26de53e675673.tar.bz2
Install some simple apps by default to make dev easier.
Review URL: http://codereview.chromium.org/1688006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45457 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r--chrome/browser/profile.cc44
1 files changed, 34 insertions, 10 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 0777837..5aac7a5 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -7,6 +7,7 @@
#include "app/resource_bundle.h"
#include "app/theme_provider.h"
#include "base/command_line.h"
+#include "base/env_var.h"
#include "base/file_path.h"
#include "base/file_util.h"
#include "base/path_service.h"
@@ -729,21 +730,44 @@ void ProfileImpl::InitExtensions() {
GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName),
true);
- // Register the bookmark manager extension.
+ // Register the component extensions.
+ std::map<std::string, int> component_extensions;
+
+ // Bookmark manager.
if (!CommandLine::ForCurrentProcess()->HasSwitch(
switches::kDisableTabbedBookmarkManager)) {
- FilePath bookmark_manager_path;
- if (PathService::Get(chrome::DIR_BOOKMARK_MANAGER,
- &bookmark_manager_path)) {
- std::string manifest =
- ResourceBundle::GetSharedInstance().GetRawDataResource(
- IDR_BOOKMARKS_MANIFEST).as_string();
- extensions_service_->register_component_extension(
- ExtensionsService::ComponentExtensionInfo(manifest,
- bookmark_manager_path));
+ component_extensions["bookmark_manager"] = IDR_BOOKMARKS_MANIFEST;
+ }
+
+ // 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 (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableExtensionApps)) {
+#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
+ }
+
+ for (std::map<std::string, int>::iterator iter = component_extensions.begin();
+ iter != component_extensions.end(); ++iter) {
+ FilePath path;
+ if (PathService::Get(chrome::DIR_RESOURCES, &path)) {
+ path = path.AppendASCII(iter->first);
} else {
NOTREACHED();
}
+
+ std::string manifest =
+ ResourceBundle::GetSharedInstance().GetRawDataResource(
+ iter->second).as_string();
+ extensions_service_->register_component_extension(
+ ExtensionsService::ComponentExtensionInfo(manifest, path));
}
extensions_service_->Init();