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

Side by Side Diff: chrome/app/chrome_main_app_mode_mac.mm

Issue 9423048: Add user data dir field to Mac platform apps (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 RAW_CHECK(!chrome_versioned_path->empty()); 44 RAW_CHECK(!chrome_versioned_path->empty());
45 chrome::SetOverrideVersionedDirectory(chrome_versioned_path); 45 chrome::SetOverrideVersionedDirectory(chrome_versioned_path);
46 46
47 base::mac::SetOverrideOuterBundlePath(info->chrome_outer_bundle_path); 47 base::mac::SetOverrideOuterBundlePath(info->chrome_outer_bundle_path);
48 base::mac::SetOverrideFrameworkBundlePath( 48 base::mac::SetOverrideFrameworkBundlePath(
49 chrome_versioned_path->Append(chrome::kFrameworkName)); 49 chrome_versioned_path->Append(chrome::kFrameworkName));
50 50
51 // TODO(viettrungluu): do something intelligent with data 51 // TODO(viettrungluu): do something intelligent with data
52 // return ChromeMain(info->argc, info->argv); 52 // return ChromeMain(info->argc, info->argv);
53 // For now, a cheesy hack instead. 53 // For now, a cheesy hack instead.
54 RAW_CHECK(info->app_mode_url.size());
55 std::string argv1(std::string("--app=") + info->app_mode_url);
56 RAW_CHECK(info->app_mode_id.size()); 54 RAW_CHECK(info->app_mode_id.size());
57 std::string argv2(std::string("--user-data-dir=/tmp/") + info->app_mode_id); 55 std::string argv1(std::string("--app-id=") + info->app_mode_id);
56 std::string argv2(
57 std::string("--user-data-dir=") + info->user_data_dir.value());
58 char* argv[] = { info->argv[0], 58 char* argv[] = { info->argv[0],
59 const_cast<char*>(argv1.c_str()), 59 const_cast<char*>(argv1.c_str()),
60 const_cast<char*>(argv2.c_str()) }; 60 const_cast<char*>(argv2.c_str()) };
61 return ChromeMain(static_cast<int>(arraysize(argv)), argv); 61 return ChromeMain(static_cast<int>(arraysize(argv)), argv);
62 } 62 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698