diff options
author | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-20 03:20:17 +0000 |
---|---|---|
committer | jhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-20 03:20:17 +0000 |
commit | 91e76bb06b98e6c00233eecd0984cf56b3efdfeb (patch) | |
tree | dd84aa58a9a8fb3297814266fed5d1d5bbb08724 /chrome/browser | |
parent | 97f973c80b84b13e9df161ed3fa1874217fb25a1 (diff) | |
download | chromium_src-91e76bb06b98e6c00233eecd0984cf56b3efdfeb.zip chromium_src-91e76bb06b98e6c00233eecd0984cf56b3efdfeb.tar.gz chromium_src-91e76bb06b98e6c00233eecd0984cf56b3efdfeb.tar.bz2 |
Make user_data_manager.cc compile on Posix.
Review URL: http://codereview.chromium.org/20525
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10074 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser.scons | 1 | ||||
-rw-r--r-- | chrome/browser/browser_main.cc | 2 | ||||
-rw-r--r-- | chrome/browser/user_data_manager.cc | 34 | ||||
-rw-r--r-- | chrome/browser/user_data_manager.h | 4 |
4 files changed, 20 insertions, 21 deletions
diff --git a/chrome/browser/browser.scons b/chrome/browser/browser.scons index f5cfd12..22ca12f 100644 --- a/chrome/browser/browser.scons +++ b/chrome/browser/browser.scons @@ -741,7 +741,6 @@ if not env.Bit('windows'): 'task_manager.cc', 'task_manager_resource_providers.cc', 'toolbar_model.cc', - 'user_data_manager.cc', 'views/download_tab_view.cc', 'window_sizer.cc', ) diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index c68d4a6..2fc22bb 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -33,6 +33,7 @@ #include "chrome/browser/net/dns_global.h" #include "chrome/browser/profile_manager.h" #include "chrome/browser/shell_integration.h" +#include "chrome/browser/user_data_manager.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" @@ -78,7 +79,6 @@ #include "chrome/browser/profile.h" #include "chrome/browser/profile_manager.h" #include "chrome/browser/rlz/rlz.h" -#include "chrome/browser/user_data_manager.h" #include "chrome/browser/views/user_data_dir_dialog.h" #include "chrome/common/env_vars.h" #include "chrome/common/win_util.h" diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc index bc078db..0914b5c 100644 --- a/chrome/browser/user_data_manager.cc +++ b/chrome/browser/user_data_manager.cc @@ -2,12 +2,12 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include "build/build_config.h" + #include "chrome/browser/user_data_manager.h" -#include <windows.h> #include <string> -#include "base/command_line.h" #include "base/file_util.h" #include "base/logging.h" #include "base/message_loop.h" @@ -20,7 +20,11 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/l10n_util.h" #include "chrome/installer/util/browser_distribution.h" + +#if defined(OS_WIN) +#include <windows.h> #include "chrome/installer/util/shell_util.h" +#endif #include "chromium_strings.h" @@ -57,12 +61,10 @@ class LaunchChromeForProfileIndexHelper : GetProfilesHelper::Delegate { LaunchChromeForProfileIndexHelper::LaunchChromeForProfileIndexHelper( const UserDataManager* manager, int index) - : manager_(manager), - index_(index), -// Don't complain about using "this" in initializer list. -MSVC_PUSH_DISABLE_WARNING(4355) - profiles_helper_(new GetProfilesHelper(this)) { -MSVC_POP_WARNING() + : index_(index), + manager_(manager), + ALLOW_THIS_IN_INITIALIZER_LIST( + profiles_helper_(new GetProfilesHelper(this))) { DCHECK(manager); } @@ -175,7 +177,7 @@ std::wstring UserDataManager::GetUserDataFolderForProfile( return folder_path; } -std::wstring UserDataManager::GetCommandForProfile( +void UserDataManager::LaunchChromeForProfile( const std::wstring& profile_name) const { std::wstring user_data_dir = GetUserDataFolderForProfile(profile_name); std::wstring command; @@ -187,13 +189,7 @@ std::wstring UserDataManager::GetCommandForProfile( PathService::Get(chrome::FILE_LOCAL_STATE, &local_state_path); command_line.AppendSwitchWithValue(switches::kParentProfile, local_state_path); - return command_line.command_line_string(); -} - -void UserDataManager::LaunchChromeForProfile( - const std::wstring& profile_name) const { - std::wstring command = GetCommandForProfile(profile_name); - base::LaunchApp(command, false, false, NULL); + base::LaunchApp(command_line, false, false, NULL); } void UserDataManager::LaunchChromeForProfile(int index) const { @@ -221,6 +217,7 @@ void UserDataManager::GetProfiles(std::vector<std::wstring>* profiles) const { bool UserDataManager::CreateDesktopShortcutForProfile( const std::wstring& profile_name) const { +#if defined(OS_WIN) std::wstring exe_path; std::wstring shortcut_path; if (!PathService::Get(base::FILE_EXE, &exe_path) || @@ -253,6 +250,11 @@ bool UserDataManager::CreateDesktopShortcutForProfile( NULL, exe_path.c_str(), 0); +#else + // TODO(port): should probably use freedesktop.org standard for desktop files. + NOTIMPLEMENTED(); + return false; +#endif } GetProfilesHelper::GetProfilesHelper(Delegate* delegate) diff --git a/chrome/browser/user_data_manager.h b/chrome/browser/user_data_manager.h index f688448..733767e 100644 --- a/chrome/browser/user_data_manager.h +++ b/chrome/browser/user_data_manager.h @@ -14,6 +14,7 @@ #include "base/basictypes.h" #include "base/ref_counted.h" +class CommandLine; class MessageLoop; // Provides an abstraction of profiles on top of the user data directory @@ -80,9 +81,6 @@ class UserDataManager { std::wstring GetUserDataFolderForProfile( const std::wstring& profile_name) const; - // Returns the command to start the app in the given profile. - std::wstring GetCommandForProfile(const std::wstring& profile_name) const; - // Shared instance. static UserDataManager* instance_; |