| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // On Mac, one can't make shortcuts with command-line arguments. Instead, we | 5 // On Mac, one can't make shortcuts with command-line arguments. Instead, we |
| 6 // produce small app bundles which locate the Chromium framework and load it, | 6 // produce small app bundles which locate the Chromium framework and load it, |
| 7 // passing the appropriate data. This is the entry point into the framework for | 7 // passing the appropriate data. This is the entry point into the framework for |
| 8 // those app bundles. | 8 // those app bundles. |
| 9 | 9 |
| 10 #include <string> // TODO(viettrungluu): only needed for temporary hack | 10 #include <string> // TODO(viettrungluu): only needed for temporary hack |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 | 39 |
| 40 RAW_CHECK(!info->chrome_versioned_path.empty()); | 40 RAW_CHECK(!info->chrome_versioned_path.empty()); |
| 41 FilePath* chrome_versioned_path = new FilePath(info->chrome_versioned_path); | 41 FilePath* chrome_versioned_path = new FilePath(info->chrome_versioned_path); |
| 42 RAW_CHECK(!chrome_versioned_path->empty()); | 42 RAW_CHECK(!chrome_versioned_path->empty()); |
| 43 chrome::SetOverrideVersionedDirectory(chrome_versioned_path); | 43 chrome::SetOverrideVersionedDirectory(chrome_versioned_path); |
| 44 | 44 |
| 45 // TODO(viettrungluu): do something intelligent with data | 45 // TODO(viettrungluu): do something intelligent with data |
| 46 // return ChromeMain(info->argc, info->argv); | 46 // return ChromeMain(info->argc, info->argv); |
| 47 // For now, a cheesy hack instead. | 47 // For now, a cheesy hack instead. |
| 48 RAW_CHECK(info->app_mode_url.size()); | |
| 49 std::string argv1(std::string("--app=") + info->app_mode_url); | |
| 50 RAW_CHECK(info->app_mode_id.size()); | 48 RAW_CHECK(info->app_mode_id.size()); |
| 51 std::string argv2(std::string("--user-data-dir=/tmp/") + info->app_mode_id); | 49 std::string argv1(std::string("--app-id=") + info->app_mode_id); |
| 50 std::string argv2( |
| 51 std::string("--user-data-dir=") + info->user_data_dir.value()); |
| 52 char* argv[] = { info->argv[0], | 52 char* argv[] = { info->argv[0], |
| 53 const_cast<char*>(argv1.c_str()), | 53 const_cast<char*>(argv1.c_str()), |
| 54 const_cast<char*>(argv2.c_str()) }; | 54 const_cast<char*>(argv2.c_str()) }; |
| 55 return ChromeMain(static_cast<int>(arraysize(argv)), argv); | 55 return ChromeMain(static_cast<int>(arraysize(argv)), argv); |
| 56 } | 56 } |
| OLD | NEW |