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

Unified Diff: chrome/app/chrome_main_app_mode_mac.mm

Issue 9374009: Install platform apps into a separate data directory (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: address review comments Created 8 years, 10 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 | « chrome/app/app_mode_loader_mac.mm ('k') | chrome/browser/extensions/app_shortcut_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_main_app_mode_mac.mm
diff --git a/chrome/app/chrome_main_app_mode_mac.mm b/chrome/app/chrome_main_app_mode_mac.mm
index b2c78244908cdbe440061cd9653a76ebb6da875d..b32ae3146f730a55b9a0d10aa65023d45d8d1bc2 100644
--- a/chrome/app/chrome_main_app_mode_mac.mm
+++ b/chrome/app/chrome_main_app_mode_mac.mm
@@ -10,9 +10,11 @@
#include <string> // TODO(viettrungluu): only needed for temporary hack
#include "base/basictypes.h"
+#include "base/command_line.h"
#include "base/file_path.h"
#include "base/logging.h"
#include "chrome/common/chrome_paths_internal.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/mac/app_mode_common.h"
extern "C" {
@@ -42,15 +44,19 @@ int ChromeAppModeStart(const app_mode::ChromeAppModeInfo* info) {
RAW_CHECK(!chrome_versioned_path->empty());
chrome::SetOverrideVersionedDirectory(chrome_versioned_path);
- // TODO(viettrungluu): do something intelligent with data
- // return ChromeMain(info->argc, info->argv);
- // For now, a cheesy hack instead.
+ CommandLine command_line(CommandLine::NO_PROGRAM);
+ command_line.AppendSwitch(info->argv[0]);
RAW_CHECK(info->app_mode_id.size());
- std::string argv1(std::string("--app-id=") + info->app_mode_id);
- std::string argv2(
- std::string("--user-data-dir=") + info->user_data_dir.value());
- char* argv[] = { info->argv[0],
- const_cast<char*>(argv1.c_str()),
- const_cast<char*>(argv2.c_str()) };
- return ChromeMain(static_cast<int>(arraysize(argv)), argv);
+ command_line.AppendSwitchASCII(switches::kAppId, info->app_mode_id);
+ command_line.AppendSwitchPath(switches::kUserDataDir, info->user_data_dir);
+ // TODO(sail): Use a different flag that doesn't imply Location::LOAD for the
+ // extension.
+ command_line.AppendSwitchPath(switches::kLoadExtension, info->extension_path);
+
+ int argc = command_line.argv().size();
+ char* argv[argc];
+ for (int i = 0; i < argc; ++i)
+ argv[i] = const_cast<char*>(command_line.argv()[i].c_str());
+
+ return ChromeMain(argc, argv);
}
« no previous file with comments | « chrome/app/app_mode_loader_mac.mm ('k') | chrome/browser/extensions/app_shortcut_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698