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

Unified Diff: apps/app_shim/chrome_main_app_mode_mac.mm

Issue 19503003: Use the shim bundle's user_data_dir instead of GetUserDataDirectoryForBrowserBundle. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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 | « apps/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
« no previous file with comments | « apps/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698