diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 17:24:22 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-23 17:24:22 +0000 |
commit | fee679820e1d129068a22e0576b26de53e675673 (patch) | |
tree | efd23477a0d0a329041b032c6e47d3926de99341 | |
parent | 7511d4c0964f65715e18019ae1614c3c53275548 (diff) | |
download | chromium_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
-rw-r--r-- | chrome/browser/browser_resources.grd | 3 | ||||
-rw-r--r-- | chrome/browser/profile.cc | 44 | ||||
-rw-r--r-- | chrome/browser/resources/calendar_app/manifest.json | 21 | ||||
-rw-r--r-- | chrome/browser/resources/docs_app/manifest.json | 19 | ||||
-rw-r--r-- | chrome/browser/resources/gmail_app/manifest.json | 21 | ||||
-rw-r--r-- | chrome/chrome_browser.gypi | 30 | ||||
-rw-r--r-- | chrome/chrome_dll.gypi | 3 | ||||
-rw-r--r-- | chrome/common/chrome_paths.cc | 5 | ||||
-rw-r--r-- | chrome/common/chrome_paths.h | 1 |
9 files changed, 131 insertions, 16 deletions
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index 420953c..9bf2c33 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd @@ -44,6 +44,9 @@ without changes to the corresponding grd file. ptrrraer --> <include name="IDR_MEDIAPLAYERPLAYLIST_HTML" file="resources\playlist.html" flattenhtml="true" type="BINDATA" /> </if> <include name="IDR_BOOKMARKS_MANIFEST" file="resources\bookmark_manager\manifest.json" type="BINDATA" /> + <include name="IDR_GMAIL_APP_MANIFEST" file="resources\gmail_app\manifest.json" type="BINDATA" /> + <include name="IDR_CALENDAR_APP_MANIFEST" file="resources\calendar_app\manifest.json" type="BINDATA" /> + <include name="IDR_DOCS_APP_MANIFEST" file="resources\docs_app\manifest.json" type="BINDATA" /> <include name="IDR_DOWNLOADS_HTML" file="resources\downloads.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_LOCAL_STRINGS_JS" file="resources\local_strings.js" type="BINDATA" /> <include name="IDR_DOM_UI_CSS" file="resources\dom_ui.css" flattenhtml="true" type="BINDATA" /> 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(); diff --git a/chrome/browser/resources/calendar_app/manifest.json b/chrome/browser/resources/calendar_app/manifest.json new file mode 100644 index 0000000..4cf0e5b --- /dev/null +++ b/chrome/browser/resources/calendar_app/manifest.json @@ -0,0 +1,21 @@ +{
+ "key": "XX3fMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCf1MLMJ1mzNVJOVqaFFX+fQ7gJLVeZN+Sq3tKnZM33oWP82xDDs345/TsFTqGV3Nj5KvmjIN5NwcW/AeBOpVeOGFujFDSTOCZv0JDKkTXLyCegSwF+ljBi0TbCrsgv2T+8Jt891+hSyw5LPjXoTX2bKz+bu016tQnGnhb6fXyCBQIDAQAB",
+ "name": "Google Calendar",
+ "version": "1.3",
+ "permissions": [ "notifications" ],
+ "icons": {
+ "128": "128.png",
+ "24": "24.png",
+ "32": "32.png",
+ "48": "48.png"
+ },
+ "web_content": {
+ "enabled": true,
+ "origin": "https://www.google.com/",
+ "paths": [ "calendar" ]
+ },
+ "launch": {
+ "type": "tab",
+ "web_url": "https://www.google.com/calendar/"
+ }
+}
diff --git a/chrome/browser/resources/docs_app/manifest.json b/chrome/browser/resources/docs_app/manifest.json new file mode 100644 index 0000000..f4893b5 --- /dev/null +++ b/chrome/browser/resources/docs_app/manifest.json @@ -0,0 +1,19 @@ +{
+ "key": "XX1fMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfjDZDDE/CHFEYjpPSDjdI3zphzGo7fSxO3+/pQs++FwvA+OpKKhmBga2Sa+f53ujDlPR8Q6mCvy1lXM4M4zD4Hg3lH2LC1wT/YXxJ28afRYW1yEo6/pbpHazij3+FneGMT2xcTyGvgoacJHXOTUqWyCN7qMOCiFDwQ6Uk1zJOPQIDAQAB",
+ "name": "Google Docs",
+ "version": "1",
+ "icons": {
+ "128": "128.png",
+ "24": "24.png",
+ "32": "32.png",
+ "48": "48.png"
+ },
+ "web_content": {
+ "enabled": true,
+ "origin": "https://docs.google.com/"
+ },
+ "launch": {
+ "type": "tab",
+ "web_url": "https://docs.google.com/"
+ }
+}
diff --git a/chrome/browser/resources/gmail_app/manifest.json b/chrome/browser/resources/gmail_app/manifest.json new file mode 100644 index 0000000..ec75488 --- /dev/null +++ b/chrome/browser/resources/gmail_app/manifest.json @@ -0,0 +1,21 @@ +{
+ "key": "XX2fMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCfjDZDDE/CHFEYjpPSDjdI3zphzGo7fSxO3+/pQs++FwvA+OpKKhmBga2Sa+f53ujDlPR8Q6mCvy1lXM4M4zD4Hg3lH2LC1wT/YXxJ28afRYW1yEo6/pbpHazij3+FneGMT2xcTyGvgoacJHXOTUqWyCN7qMOCiFDwQ6Uk1zJOPQIDAQAB",
+ "name": "Google Mail",
+ "version": "1",
+ "icons": {
+ "128": "128.png",
+ "24": "24.png",
+ "32": "32.png",
+ "48": "48.png"
+ },
+ "permissions": [ "notifications" ],
+ "web_content": {
+ "enabled": true,
+ "origin": "https://mail.google.com/",
+ "paths": [ "mail" ]
+ },
+ "launch": {
+ "type": "tab",
+ "web_url": "https://mail.google.com/"
+ }
+}
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi index f2cb7a5..a461824 100644 --- a/chrome/chrome_browser.gypi +++ b/chrome/chrome_browser.gypi @@ -3251,6 +3251,36 @@ 'browser/resources/bookmark_manager/images/folder_open_rtl.png', ] }, + { + 'destination': '<(PRODUCT_DIR)/resources/gmail_app', + 'files': [ + 'browser/resources/gmail_app/manifest.json', + 'browser/resources/gmail_app/128.png', + 'browser/resources/gmail_app/48.png', + 'browser/resources/gmail_app/32.png', + 'browser/resources/gmail_app/24.png', + ] + }, + { + 'destination': '<(PRODUCT_DIR)/resources/calendar_app', + 'files': [ + 'browser/resources/calendar_app/manifest.json', + 'browser/resources/calendar_app/128.png', + 'browser/resources/calendar_app/48.png', + 'browser/resources/calendar_app/32.png', + 'browser/resources/calendar_app/24.png', + ] + }, + { + 'destination': '<(PRODUCT_DIR)/resources/docs_app', + 'files': [ + 'browser/resources/docs_app/manifest.json', + 'browser/resources/docs_app/128.png', + 'browser/resources/docs_app/48.png', + 'browser/resources/docs_app/32.png', + 'browser/resources/docs_app/24.png', + ] + }, ] }, { diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi index 8a489f8..3665631 100644 --- a/chrome/chrome_dll.gypi +++ b/chrome/chrome_dll.gypi @@ -393,6 +393,9 @@ 'files': [ '<(PRODUCT_DIR)/resources/inspector/', '<(PRODUCT_DIR)/resources/bookmark_manager/', + '<(PRODUCT_DIR)/resources/gmail_app/', + '<(PRODUCT_DIR)/resources/calendar_app/', + '<(PRODUCT_DIR)/resources/docs_app/', '<(PRODUCT_DIR)/resources/net_internals/' ], 'conditions': [ diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index cebdf386..3f5e055 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -151,11 +151,6 @@ bool PathProvider(int key, FilePath* result) { cur = cur.Append(FILE_PATH_LITERAL("resources")); #endif break; - case chrome::DIR_BOOKMARK_MANAGER: - if (!PathService::Get(chrome::DIR_RESOURCES, &cur)) - return false; - cur = cur.Append(FILE_PATH_LITERAL("bookmark_manager")); - break; case chrome::DIR_INSPECTOR: if (!PathService::Get(chrome::DIR_RESOURCES, &cur)) return false; diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h index 43bf351..47dff30 100644 --- a/chrome/common/chrome_paths.h +++ b/chrome/common/chrome_paths.h @@ -22,7 +22,6 @@ enum { DIR_USER_DESKTOP, // Directory that correspond to the desktop. DIR_RESOURCES, // Directory containing separate file resources // used by Chrome at runtime. - DIR_BOOKMARK_MANAGER, // Directory containing the bookmark manager. DIR_INSPECTOR, // Directory where web inspector is located. DIR_NET_INTERNALS, // Directory where net internals is located. DIR_APP_DICTIONARIES, // Directory where the global dictionaries are. |