Chromium Code Reviews| Index: apps/app_shim/chrome_main_app_mode_mac.mm |
| diff --git a/apps/app_shim/chrome_main_app_mode_mac.mm b/apps/app_shim/chrome_main_app_mode_mac.mm |
| index 2302b047b7e464779dc016a6d668ed2fa6e9de36..04fb49e7ac37b651d2f3e3b1b93df49f643a04d9 100644 |
| --- a/apps/app_shim/chrome_main_app_mode_mac.mm |
| +++ b/apps/app_shim/chrome_main_app_mode_mac.mm |
| @@ -23,7 +23,6 @@ |
| #include "base/strings/sys_string_conversions.h" |
| #include "base/threading/thread.h" |
| #include "chrome/common/chrome_paths.h" |
| -#include "chrome/common/chrome_paths_internal.h" |
| #include "chrome/common/chrome_switches.h" |
| #include "chrome/common/mac/app_mode_common.h" |
| #include "ipc/ipc_channel_proxy.h" |
| @@ -97,18 +96,20 @@ AppShimController::AppShimController() : channel_(NULL), |
| void AppShimController::Init() { |
| DCHECK(g_io_thread); |
| - NSString* chrome_bundle_path = |
| - base::SysUTF8ToNSString(g_info->chrome_outer_bundle_path.value()); |
| - NSBundle* chrome_bundle = [NSBundle bundleWithPath:chrome_bundle_path]; |
| - base::FilePath user_data_dir; |
| - if (!chrome::GetUserDataDirectoryForBrowserBundle(chrome_bundle, |
|
tapted
2013/07/17 08:34:21
I started wondering whether this approach was chos
jackhou1
2013/07/30 07:34:34
The Info.plist has Chrome's bundle id, which app_m
|
| - &user_data_dir)) { |
| + if (g_info->user_data_dir.empty()) { |
|
tapted
2013/07/17 08:34:21
Can a shim ever be created like this? Maybe just C
jackhou1
2013/07/30 07:34:34
Done.
|
| Close(); |
| return; |
| } |
| - base::FilePath socket_path = |
| - user_data_dir.Append(app_mode::kAppShimSocketName); |
| + base::FilePath socket_path; |
| + base::FilePath maybe_profile_dir = |
|
tapted
2013/07/17 08:34:21
Perhaps a helper function, which describes the log
jackhou1
2013/07/30 07:34:34
Since we're not changing the user_data_dir field,
|
| + g_info->user_data_dir.DirName().DirName().BaseName(); |
| + if (maybe_profile_dir == g_info->profile_dir) |
|
tapted
2013/07/17 08:34:21
What happens if someone's Chrome user data dir is
jackhou1
2013/07/30 07:34:34
Obsolete since we're leaving the user_data_dir unc
|
| + socket_path = g_info->user_data_dir.DirName().DirName().DirName(); |
| + else |
| + socket_path = g_info->user_data_dir; |
| + |
| + socket_path = socket_path.Append(app_mode::kAppShimSocketName); |
| IPC::ChannelHandle handle(socket_path.value()); |
| channel_ = new IPC::ChannelProxy(handle, IPC::Channel::MODE_NAMED_CLIENT, |
| this, g_io_thread->message_loop_proxy().get()); |