diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 21:54:32 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-28 21:54:32 +0000 |
commit | f7011fcb7f28651953b1765b241c974e25c8cd40 (patch) | |
tree | f3a2c97bb98cc12aaca39bb27791998f026b58b7 /chrome | |
parent | 4663213354a9c41ab0e5a785d52bf5c9a9692514 (diff) | |
download | chromium_src-f7011fcb7f28651953b1765b241c974e25c8cd40.zip chromium_src-f7011fcb7f28651953b1765b241c974e25c8cd40.tar.gz chromium_src-f7011fcb7f28651953b1765b241c974e25c8cd40.tar.bz2 |
Porting profiles to the Mac.
Review URL: http://codereview.chromium.org/19623
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
52 files changed, 797 insertions, 367 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 2112218..3895ece 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -9,6 +9,7 @@ #import "chrome/browser/browser.h" #import "chrome/browser/browser_list.h" #import "chrome/browser/command_updater.h" +#import "chrome/browser/profile_manager.h" #import "chrome/common/temp_scaffolding_stubs.h" @interface AppController(PRIVATE) @@ -74,13 +75,16 @@ // command is supported and doesn't check, otherwise it would have been disabled // in the UI in validateUserInterfaceItem:. - (void)commandDispatch:(id)sender { + // How to get the profile created on line 314 of browser_main? Ugh. TODO:FIXME + Profile* default_profile = *g_browser_process->profile_manager()->begin(); + NSInteger tag = [sender tag]; switch (tag) { case IDC_NEW_WINDOW: - Browser::OpenEmptyWindow(ProfileManager::FakeProfile()); + Browser::OpenEmptyWindow(default_profile); break; case IDC_NEW_INCOGNITO_WINDOW: - Browser::OpenURLOffTheRecord(ProfileManager::FakeProfile(), GURL()); + Browser::OpenURLOffTheRecord(default_profile, GURL()); break; }; } diff --git a/chrome/browser/back_forward_menu_model_unittest.cc b/chrome/browser/back_forward_menu_model_unittest.cc index dbf4e4c..20f718d 100644 --- a/chrome/browser/back_forward_menu_model_unittest.cc +++ b/chrome/browser/back_forward_menu_model_unittest.cc @@ -75,7 +75,8 @@ class BackFwdMenuModelTest : public testing::Test { profile_path_ = test_dir_; file_util::AppendToPath(&profile_path_, L"New Profile"); - profile_ = ProfileManager::CreateProfile(profile_path_, + profile_ = ProfileManager::CreateProfile( + FilePath::FromWStringHack(profile_path_), L"New Profile", L"new-profile", L""); ASSERT_TRUE(profile_); pm_.AddProfile(profile_); @@ -85,7 +86,7 @@ class BackFwdMenuModelTest : public testing::Test { TabContents::RegisterFactory(kHTTPTabContentsType, NULL); // Removes a profile from the set of currently-loaded profiles. - pm_.RemoveProfileByPath(profile_path_); + pm_.RemoveProfileByPath(FilePath::FromWStringHack(profile_path_)); // Clean up test directory ASSERT_TRUE(file_util::Delete(test_dir_, true)); diff --git a/chrome/browser/bookmarks/bookmark_drag_data.cc b/chrome/browser/bookmarks/bookmark_drag_data.cc index 2e7285a..73ac107 100644 --- a/chrome/browser/bookmarks/bookmark_drag_data.cc +++ b/chrome/browser/bookmarks/bookmark_drag_data.cc @@ -92,7 +92,8 @@ void BookmarkDragData::Write(Profile* profile, OSExchangeData* data) const { } Pickle data_pickle; - data_pickle.WriteWString(profile ? profile->GetPath() : std::wstring()); + data_pickle.WriteWString( + profile ? profile->GetPath().ToWStringHack() : std::wstring()); data_pickle.WriteSize(elements.size()); for (size_t i = 0; i < elements.size(); ++i) @@ -163,5 +164,6 @@ BookmarkNode* BookmarkDragData::GetFirstNode(Profile* profile) const { bool BookmarkDragData::IsFromProfile(Profile* profile) const { // An empty path means the data is not associated with any profile. - return (!profile_path_.empty() && profile->GetPath() == profile_path_); + return (!profile_path_.empty() && + profile->GetPath().ToWStringHack() == profile_path_); } diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index a78dec6..1ef384c 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -773,7 +773,7 @@ TEST_F(BookmarkModelTestWithProfile2, MigrateFromDBToFileTest) { PathService::Get(chrome::DIR_TEST_DATA, &old_history_path); file_util::AppendToPath(&old_history_path, L"bookmarks"); file_util::AppendToPath(&old_history_path, L"History_with_starred"); - std::wstring new_history_path = profile_->GetPath(); + std::wstring new_history_path = profile_->GetPath().ToWStringHack(); file_util::Delete(new_history_path, true); file_util::CreateDirectory(new_history_path); file_util::AppendToPath(&new_history_path, chrome::kHistoryFilename); diff --git a/chrome/browser/bookmarks/bookmark_storage.cc b/chrome/browser/bookmarks/bookmark_storage.cc index 23f47b4..a159e62 100644 --- a/chrome/browser/bookmarks/bookmark_storage.cc +++ b/chrome/browser/bookmarks/bookmark_storage.cc @@ -34,9 +34,9 @@ BookmarkStorage::BookmarkStorage(Profile* profile, BookmarkModel* model) : model_(model), ALLOW_THIS_IN_INITIALIZER_LIST(save_factory_(this)), backend_thread_(g_browser_process->file_thread()) { - std::wstring path = profile->GetPath(); + std::wstring path = profile->GetPath().ToWStringHack(); file_util::AppendToPath(&path, chrome::kBookmarksFileName); - std::wstring tmp_history_path = profile->GetPath(); + std::wstring tmp_history_path = profile->GetPath().ToWStringHack(); file_util::AppendToPath(&tmp_history_path, chrome::kHistoryBookmarksFileName); backend_ = new BookmarkStorageBackend(path, tmp_history_path); } diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index d685068..368d61d 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -10,6 +10,7 @@ #include "chrome/browser/browser_list.h" #include "chrome/browser/location_bar.h" #include "chrome/browser/metrics/user_metrics.h" +#include "chrome/browser/profile.h" #include "chrome/browser/tab_contents/tab_contents_type.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" @@ -47,7 +48,6 @@ #include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/plugin_process_host.h" #include "chrome/browser/plugin_service.h" -#include "chrome/browser/profile.h" #include "chrome/browser/sessions/session_service.h" #include "chrome/browser/ssl/ssl_error_info.h" #include "chrome/browser/status_bubble.h" diff --git a/chrome/browser/browser_list.cc b/chrome/browser/browser_list.cc index 739dadb..de66406 100644 --- a/chrome/browser/browser_list.cc +++ b/chrome/browser/browser_list.cc @@ -12,10 +12,10 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/browser_shutdown.h" #include "chrome/browser/browser_window.h" +#include "chrome/browser/profile_manager.h" #if defined(OS_WIN) // TODO(port): these can probably all go away, even on win #include "chrome/browser/profile.h" -#include "chrome/browser/profile_manager.h" #include "chrome/browser/tab_contents/web_contents.h" #include "chrome/common/notification_service.h" #endif diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 8431d5d..980ae97 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -22,6 +22,7 @@ #include "chrome/browser/browser_main_win.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/plugin_service.h" +#include "chrome/browser/profile_manager.h" #include "chrome/browser/shell_integration.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" @@ -215,7 +216,7 @@ int BrowserMain(const MainFunctionParams& parameters) { main_message_loop.set_thread_name(thread_name); bool already_running = Upgrade::IsBrowserAlreadyRunning(); - std::wstring user_data_dir; + FilePath user_data_dir; PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); MessageWindow message_window(user_data_dir); @@ -263,8 +264,7 @@ int BrowserMain(const MainFunctionParams& parameters) { // On first run, we need to process the master preferences before the // browser's profile_manager object is created. first_run_ui_bypass = - !FirstRun::ProcessMasterPreferences(user_data_dir, - std::wstring(), NULL); + !FirstRun::ProcessMasterPreferences(user_data_dir, FilePath(), NULL); // If we are running in App mode, we do not want to show the importer // (first run) UI. @@ -318,7 +318,8 @@ int BrowserMain(const MainFunctionParams& parameters) { Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); if (!profile) { #if defined(OS_WIN) - user_data_dir = UserDataDirDialog::RunUserDataDirDialog(user_data_dir); + user_data_dir = FilePath::FromWStringHack( + UserDataDirDialog::RunUserDataDirDialog(user_data_dir.ToWStringHack())); // Flush the message loop which lets the UserDataDirDialog close. MessageLoop::current()->Run(); @@ -331,7 +332,7 @@ int BrowserMain(const MainFunctionParams& parameters) { // sounds risky if we parse differently than CommandLineToArgvW. CommandLine new_command_line = parsed_command_line; new_command_line.AppendSwitchWithValue(switches::kUserDataDir, - user_data_dir); + user_data_dir.ToWStringHack()); base::LaunchApp(new_command_line, false, false, NULL); } diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index 5ea298e..0f97b7b 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -423,7 +423,7 @@ int STDCALL CPB_GetBrowsingContextInfo( PluginService* service = PluginService::GetInstance(); if (!service) return CPERR_FAILURE; - std::wstring wretval = service->GetChromePluginDataDir(); + std::wstring wretval = service->GetChromePluginDataDir().ToWStringHack(); file_util::AppendToPath(&wretval, chrome::kChromePluginDataDirname); *static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, WideToUTF8(wretval)); return CPERR_SUCCESS; diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc index e1cabb2..0e333ef 100755 --- a/chrome/browser/first_run.cc +++ b/chrome/browser/first_run.cc @@ -83,15 +83,16 @@ bool GetBackupChromeFile(std::wstring* path) { std::wstring GetDefaultPrefFilePath(bool create_profile_dir, const std::wstring& user_data_dir) { - std::wstring default_pref_dir = - ProfileManager::GetDefaultProfileDir(user_data_dir); + FilePath default_pref_dir = ProfileManager::GetDefaultProfileDir( + FilePath::FromWStringHack(user_data_dir)); if (create_profile_dir) { if (!file_util::PathExists(default_pref_dir)) { if (!file_util::CreateDirectory(default_pref_dir)) return std::wstring(); } } - return ProfileManager::GetDefaultProfilePath(default_pref_dir); + return ProfileManager::GetDefaultProfilePath(default_pref_dir) + .ToWStringHack(); } bool InvokeGoogleUpdateForRename() { @@ -180,8 +181,8 @@ bool FirstRun::CreateSentinel() { } bool FirstRun::ProcessMasterPreferences( - const std::wstring& user_data_dir, - const std::wstring& master_prefs_path, + const FilePath& user_data_dir, + const FilePath& master_prefs_path, int* preference_details) { DCHECK(!user_data_dir.empty()); if (preference_details) @@ -196,7 +197,7 @@ bool FirstRun::ProcessMasterPreferences( file_util::AppendToPath(&master_path, installer_util::kDefaultMasterPrefs); master_prefs = master_path; } else { - master_prefs = master_prefs_path; + master_prefs = master_prefs_path.ToWStringHack(); } int parse_result = installer_util::ParseDistributionPreferences(master_prefs); @@ -218,13 +219,14 @@ bool FirstRun::ProcessMasterPreferences( } } - std::wstring user_prefs = GetDefaultPrefFilePath(true, user_data_dir); + FilePath user_prefs = FilePath::FromWStringHack( + GetDefaultPrefFilePath(true, user_data_dir.ToWStringHack())); if (user_prefs.empty()) return true; // The master prefs are regular prefs so we can just copy the file // to the default place and they just work. - if (!file_util::CopyFile(master_prefs, user_prefs)) + if (!file_util::CopyFile(master_prefs, user_prefs.ToWStringHack())) return true; if (!(parse_result & installer_util::MASTER_PROFILE_NO_FIRST_RUN_UI)) diff --git a/chrome/browser/first_run.h b/chrome/browser/first_run.h index 676bd49..f39e365 100644 --- a/chrome/browser/first_run.h +++ b/chrome/browser/first_run.h @@ -60,8 +60,8 @@ class FirstRun { // // See chrome/installer/util/master_preferences.h for a description of // 'master_preferences' file. - static bool ProcessMasterPreferences(const std::wstring& user_data_dir, - const std::wstring& master_prefs_path, + static bool ProcessMasterPreferences(const FilePath& user_data_dir, + const FilePath& master_prefs_path, int* preference_details); // Sets the kShouldShowFirstRunBubble local state pref so that the browser diff --git a/chrome/browser/history/history.cc b/chrome/browser/history/history.cc index 99838a1..6e55160 100644 --- a/chrome/browser/history/history.cc +++ b/chrome/browser/history/history.cc @@ -123,14 +123,15 @@ HistoryService::~HistoryService() { } } -bool HistoryService::Init(const std::wstring& history_dir, +bool HistoryService::Init(const FilePath& history_dir, BookmarkService* bookmark_service) { if (!thread_->Start()) return false; // Create the history backend. scoped_refptr<HistoryBackend> backend( - new HistoryBackend(history_dir, new BackendDelegate(this), + new HistoryBackend(history_dir.ToWStringHack(), + new BackendDelegate(this), bookmark_service)); history_backend_.swap(backend); diff --git a/chrome/browser/history/history.h b/chrome/browser/history/history.h index 0e5a492..b0351c9 100644 --- a/chrome/browser/history/history.h +++ b/chrome/browser/history/history.h @@ -27,6 +27,7 @@ class BookmarkService; struct DownloadCreateInfo; +class FilePath; class GURL; class HistoryURLProvider; struct HistoryURLProviderParams; @@ -100,7 +101,7 @@ class HistoryService : public CancelableRequestProvider, // not call any other functions. The given directory will be used for storing // the history files. The BookmarkService is used when deleting URLs to // test if a URL is bookmarked; it may be NULL during testing. - bool Init(const std::wstring& history_dir, BookmarkService* bookmark_service); + bool Init(const FilePath& history_dir, BookmarkService* bookmark_service); // Did the backend finish loading the databases? bool backend_loaded() const { return backend_loaded_; } diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index fd7d465..670555b 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -471,7 +471,8 @@ void HistoryBackend::InitImpl() { // Compute the file names. Note that the index file can be removed when the // text db manager is finished being hooked up. std::wstring history_name = history_dir_; - file_util::AppendToPath(&history_name, chrome::kHistoryFilename); + file_util::AppendToPath(&history_name, + FilePath(chrome::kHistoryFilename).ToWStringHack()); std::wstring thumbnail_name = GetThumbnailFileName(); std::wstring archived_name = GetArchivedFileName(); std::wstring tmp_bookmarks_file = history_dir_; diff --git a/chrome/browser/history/history_querying_unittest.cc b/chrome/browser/history/history_querying_unittest.cc index 18cbf21..153ee5c1 100644 --- a/chrome/browser/history/history_querying_unittest.cc +++ b/chrome/browser/history/history_querying_unittest.cc @@ -89,7 +89,7 @@ class HistoryQueryTest : public testing::Test { file_util::CreateDirectory(history_dir_); history_ = new HistoryService; - if (!history_->Init(history_dir_, NULL)) { + if (!history_->Init(FilePath::FromWStringHack(history_dir_), NULL)) { history_ = NULL; // Tests should notice this NULL ptr & fail. return; } diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 3018f25..6677145 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -378,7 +378,7 @@ TEST_F(HistoryTest, ClearBrowsingData_Downloads) { TEST_F(HistoryTest, AddPage) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); // Add the page once from a child frame. const GURL test_url("http://www.google.com/"); @@ -402,7 +402,7 @@ TEST_F(HistoryTest, AddPage) { TEST_F(HistoryTest, AddPageSameTimes) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); Time now = Time::Now(); const GURL test_urls[] = { @@ -442,7 +442,7 @@ TEST_F(HistoryTest, AddPageSameTimes) { TEST_F(HistoryTest, AddRedirect) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); const wchar_t* first_sequence[] = { L"http://first.page/", @@ -513,7 +513,7 @@ TEST_F(HistoryTest, AddRedirect) { TEST_F(HistoryTest, Typed) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); // Add the page once as typed. const GURL test_url("http://www.google.com/"); @@ -556,7 +556,7 @@ TEST_F(HistoryTest, Typed) { TEST_F(HistoryTest, SetTitle) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); // Add a URL. const GURL existing_url(L"http://www.google.com/"); @@ -587,7 +587,7 @@ TEST_F(HistoryTest, Segments) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); static const void* scope = static_cast<void*>(this); @@ -653,7 +653,7 @@ TEST_F(HistoryTest, Segments) { TEST_F(HistoryTest, Thumbnails) { scoped_refptr<HistoryService> history(new HistoryService); history_service_ = history; - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); scoped_ptr<SkBitmap> thumbnail( JPEGCodec::Decode(kGoogleThumbnail, sizeof(kGoogleThumbnail))); @@ -803,7 +803,7 @@ class HistoryDBTaskImpl : public HistoryDBTask { TEST_F(HistoryTest, HistoryDBTask) { CancelableRequestConsumerT<int, 0> request_consumer; HistoryService* history = new HistoryService(); - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); scoped_refptr<HistoryDBTaskImpl> task(new HistoryDBTaskImpl()); history_service_ = history; history->ScheduleDBTask(task.get(), &request_consumer); @@ -821,7 +821,7 @@ TEST_F(HistoryTest, HistoryDBTask) { TEST_F(HistoryTest, HistoryDBTaskCanceled) { CancelableRequestConsumerT<int, 0> request_consumer; HistoryService* history = new HistoryService(); - ASSERT_TRUE(history->Init(history_dir_, NULL)); + ASSERT_TRUE(history->Init(FilePath::FromWStringHack(history_dir_), NULL)); scoped_refptr<HistoryDBTaskImpl> task(new HistoryDBTaskImpl()); history_service_ = history; history->ScheduleDBTask(task.get(), &request_consumer); diff --git a/chrome/browser/message_window.cc b/chrome/browser/message_window.cc index 13eb763..1def5a7 100644 --- a/chrome/browser/message_window.cc +++ b/chrome/browser/message_window.cc @@ -34,14 +34,14 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) { } // namespace -MessageWindow::MessageWindow(const std::wstring& user_data_dir) +MessageWindow::MessageWindow(const FilePath& user_data_dir) : window_(NULL), locked_(false) { // Look for a Chrome instance that uses the same profile directory: remote_window_ = FindWindowEx(HWND_MESSAGE, NULL, chrome::kMessageWindowClass, - user_data_dir.c_str()); + user_data_dir.ToWStringHack().c_str()); } MessageWindow::~MessageWindow() { @@ -199,7 +199,7 @@ LRESULT MessageWindow::OnCopyData(HWND hwnd, const COPYDATASTRUCT* cds) { PrefService* prefs = g_browser_process->local_state(); DCHECK(prefs); - std::wstring user_data_dir; + FilePath user_data_dir; PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); ProfileManager* profile_manager = g_browser_process->profile_manager(); Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); diff --git a/chrome/browser/message_window.h b/chrome/browser/message_window.h index 1d0d732..632c82d 100644 --- a/chrome/browser/message_window.h +++ b/chrome/browser/message_window.h @@ -9,6 +9,7 @@ #include <windows.h> #include "base/basictypes.h" +#include "base/file_path.h" // MessageWindow ------------------------------------------------------------- // @@ -20,7 +21,7 @@ class MessageWindow { public: - explicit MessageWindow(const std::wstring& user_data_dir); + explicit MessageWindow(const FilePath& user_data_dir); ~MessageWindow(); // Returns true if another process was found and notified, false if we diff --git a/chrome/browser/navigation_controller_unittest.cc b/chrome/browser/navigation_controller_unittest.cc index 09c93e6..1019d80 100644 --- a/chrome/browser/navigation_controller_unittest.cc +++ b/chrome/browser/navigation_controller_unittest.cc @@ -147,7 +147,8 @@ class NavigationControllerHistoryTest : public NavigationControllerTest { // Create a profile. profile_manager_ = new ProfileManager(); - profile = ProfileManager::CreateProfile(profile_path_, + profile = ProfileManager::CreateProfile( + FilePath::FromWStringHack(profile_path_), L"New Profile", L"new-profile", L""); ASSERT_TRUE(profile); profile_manager_->AddProfile(profile); @@ -189,8 +190,10 @@ class NavigationControllerHistoryTest : public NavigationControllerTest { helper_.set_service(NULL); delete profile_manager_; profile_manager_ = new ProfileManager(); - profile_manager_->AddProfileByPath(profile_path_); - profile = profile_manager_->GetProfileByPath(profile_path_); + profile_manager_->AddProfileByPath( + FilePath::FromWStringHack(profile_path_)); + profile = profile_manager_->GetProfileByPath( + FilePath::FromWStringHack(profile_path_)); helper_.set_service(profile->GetSessionService()); } diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc index 5cd4688..7a4c3bb 100644 --- a/chrome/browser/net/chrome_url_request_context.cc +++ b/chrome/browser/net/chrome_url_request_context.cc @@ -37,8 +37,8 @@ static net::ProxyInfo* CreateProxyInfo() { // static ChromeURLRequestContext* ChromeURLRequestContext::CreateOriginal( - Profile* profile, const std::wstring& cookie_store_path, - const std::wstring& disk_cache_path) { + Profile* profile, const FilePath& cookie_store_path, + const FilePath& disk_cache_path) { DCHECK(!profile->IsOffTheRecord()); ChromeURLRequestContext* context = new ChromeURLRequestContext(profile); @@ -46,7 +46,8 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateOriginal( context->proxy_service_ = net::ProxyService::Create(proxy_info.get()); net::HttpCache* cache = - new net::HttpCache(context->proxy_service_, disk_cache_path, 0); + new net::HttpCache(context->proxy_service_, + disk_cache_path.ToWStringHack(), 0); const CommandLine& command_line = *CommandLine::ForCurrentProcess(); bool record_mode = chrome::kRecordModeEnabled && @@ -65,7 +66,8 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateOriginal( if (!context->cookie_store_) { DCHECK(!cookie_store_path.empty()); context->cookie_db_.reset(new SQLitePersistentCookieStore( - cookie_store_path, g_browser_process->db_thread()->message_loop())); + cookie_store_path.ToWStringHack(), + g_browser_process->db_thread()->message_loop())); context->cookie_store_ = new net::CookieMonster(context->cookie_db_.get()); } diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h index 915322e..f9cfafac 100644 --- a/chrome/browser/net/chrome_url_request_context.h +++ b/chrome/browser/net/chrome_url_request_context.h @@ -25,8 +25,8 @@ class ChromeURLRequestContext : public URLRequestContext, // Create an instance for use with an 'original' (non-OTR) profile. This is // expected to get called on the UI thread. static ChromeURLRequestContext* CreateOriginal( - Profile* profile, const std::wstring& cookie_store_path, - const std::wstring& disk_cache_path); + Profile* profile, const FilePath& cookie_store_path, + const FilePath& disk_cache_path); // Create an instance for use with an OTR profile. This is expected to get // called on the UI thread. diff --git a/chrome/browser/plugin_process_host.cc b/chrome/browser/plugin_process_host.cc index 7c272a5..0254f95 100644 --- a/chrome/browser/plugin_process_host.cc +++ b/chrome/browser/plugin_process_host.cc @@ -513,7 +513,8 @@ bool PluginProcessHost::Init(const FilePath& plugin_path, } // Gears requires the data dir to be available on startup. - std::wstring data_dir = plugin_service_->GetChromePluginDataDir();; + std::wstring data_dir = + plugin_service_->GetChromePluginDataDir().ToWStringHack(); DCHECK(!data_dir.empty()); cmd_line.AppendSwitchWithValue(switches::kPluginDataDir, data_dir); diff --git a/chrome/browser/plugin_service.cc b/chrome/browser/plugin_service.cc index f31dc68..032842c 100644 --- a/chrome/browser/plugin_service.cc +++ b/chrome/browser/plugin_service.cc @@ -45,12 +45,12 @@ void PluginService::LoadChromePlugins( ChromePluginLib::LoadChromePlugins(GetCPBrowserFuncsForBrowser()); } -void PluginService::SetChromePluginDataDir(const std::wstring& data_dir) { +void PluginService::SetChromePluginDataDir(const FilePath& data_dir) { AutoLock lock(lock_); chrome_plugin_data_dir_ = data_dir; } -const std::wstring& PluginService::GetChromePluginDataDir() { +const FilePath& PluginService::GetChromePluginDataDir() { AutoLock lock(lock_); return chrome_plugin_data_dir_; } diff --git a/chrome/browser/plugin_service.h b/chrome/browser/plugin_service.h index 2ee90b7..3bca25f 100644 --- a/chrome/browser/plugin_service.h +++ b/chrome/browser/plugin_service.h @@ -48,8 +48,8 @@ class PluginService { // Sets/gets the data directory that Chrome plugins should use to store // persistent data. - void SetChromePluginDataDir(const std::wstring& data_dir); - const std::wstring& GetChromePluginDataDir(); + void SetChromePluginDataDir(const FilePath& data_dir); + const FilePath& GetChromePluginDataDir(); // Gets the browser's UI locale. const std::wstring& GetUILocale(); @@ -131,7 +131,7 @@ class PluginService { ResourceDispatcherHost* resource_dispatcher_host_; // The data directory that Chrome plugins should use to store persistent data. - std::wstring chrome_plugin_data_dir_; + FilePath chrome_plugin_data_dir_; // The browser's UI locale. const std::wstring ui_locale_; diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 5af89c9..b4fd605 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -13,22 +13,13 @@ #include "base/string_util.h" #include "base/values.h" #include "chrome/app/locales/locale_settings.h" -#include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/download/download_manager.h" #include "chrome/browser/extensions/extensions_service.h" #include "chrome/browser/extensions/user_script_master.h" -#include "chrome/browser/history/history.h" #include "chrome/browser/net/chrome_url_request_context.h" #include "chrome/browser/profile_manager.h" #include "chrome/browser/renderer_host/render_process_host.h" -#include "chrome/browser/search_engines/template_url_fetcher.h" -#include "chrome/browser/search_engines/template_url_model.h" -#include "chrome/browser/sessions/session_service.h" -#include "chrome/browser/sessions/tab_restore_service.h" -#include "chrome/browser/spellchecker.h" -#include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/visitedlink_master.h" #include "chrome/browser/webdata/web_data_service.h" #include "chrome/common/chrome_constants.h" @@ -38,6 +29,7 @@ #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" +#include "chrome/common/render_messages.h" #include "chrome/common/resource_bundle.h" #include "net/base/cookie_monster.h" #include "net/base/cookie_policy.h" @@ -46,6 +38,25 @@ #include "net/url_request/url_request_context.h" #include "webkit/glue/webkit_glue.h" +#if defined(OS_POSIX) +// TODO(port): get rid of this include. It's used just to provide declarations +// and stub definitions for classes we encouter during the porting effort. +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + +// TODO(port): Get rid of this section and finish porting. +#if defined(OS_WIN) +#include "chrome/browser/bookmarks/bookmark_model.h" +#include "chrome/browser/download/download_manager.h" +#include "chrome/browser/history/history.h" +#include "chrome/browser/search_engines/template_url_fetcher.h" +#include "chrome/browser/search_engines/template_url_model.h" +#include "chrome/browser/sessions/session_service.h" +#include "chrome/browser/sessions/tab_restore_service.h" +#include "chrome/browser/spellchecker.h" +#include "chrome/browser/tab_contents/navigation_controller.h" +#endif + using base::Time; using base::TimeDelta; @@ -61,13 +72,20 @@ void Profile::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, true); prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly, true); prefs->RegisterBooleanPref(prefs::kSafeBrowsingEnabled, true); +#if defined(OS_MACOSX) + // MASSIVE HACK!!! We don't have localization working yet. Undo this once we + // do. TODO(port): take this out + prefs->RegisterStringPref(prefs::kSpellCheckDictionary, + L"IDS_SPELLCHECK_DICTIONARY"); +#elif defined(OS_WIN) || defined(OS_LINUX) prefs->RegisterLocalizedStringPref(prefs::kSpellCheckDictionary, IDS_SPELLCHECK_DICTIONARY); +#endif prefs->RegisterBooleanPref(prefs::kEnableSpellCheck, true); } //static -Profile* Profile::CreateProfile(const std::wstring& path) { +Profile* Profile::CreateProfile(const FilePath& path) { return new ProfileImpl(path); } @@ -112,7 +130,7 @@ class OffTheRecordProfileImpl : public Profile, this, NOTIFY_BROWSER_CLOSED, NotificationService::AllSources()); } - virtual std::wstring GetPath() { return profile_->GetPath(); } + virtual FilePath GetPath() { return profile_->GetPath(); } virtual bool IsOffTheRecord() { return true; @@ -298,18 +316,18 @@ class OffTheRecordProfileImpl : public Profile, DISALLOW_EVIL_CONSTRUCTORS(OffTheRecordProfileImpl); }; -ProfileImpl::ProfileImpl(const std::wstring& path) +ProfileImpl::ProfileImpl(const FilePath& path) : path_(path), off_the_record_(false), +#ifdef CHROME_PERSONALIZATION + personalization_(NULL), +#endif + request_context_(NULL), history_service_created_(false), created_web_data_service_(false), created_download_manager_(false), - request_context_(NULL), start_time_(Time::Now()), spellchecker_(NULL), -#ifdef CHROME_PERSONALIZATION - personalization_(NULL), -#endif shutdown_session_service_(false) { DCHECK(!path.empty()) << "Using an empty path will attempt to write " << "profile files to the root directory!"; @@ -329,14 +347,14 @@ void ProfileImpl::InitExtensions() { bool extensions_enabled = command_line->HasSwitch(switches::kEnableExtensions); - std::wstring script_dir; + FilePath script_dir; if (user_scripts_enabled) { script_dir = GetPath(); - file_util::AppendToPath(&script_dir, chrome::kUserScriptsDirname); + script_dir = script_dir.Append(chrome::kUserScriptsDirname); } user_script_master_ = new UserScriptMaster( - g_browser_process->file_thread()->message_loop(), FilePath(script_dir)); + g_browser_process->file_thread()->message_loop(), script_dir); extensions_service_ = new ExtensionsService( FilePath(GetPath()), user_script_master_.get()); @@ -418,7 +436,7 @@ ProfileImpl::~ProfileImpl() { MarkAsCleanShutdown(); } -std::wstring ProfileImpl::GetPath() { +FilePath ProfileImpl::GetPath() { return path_; } @@ -449,10 +467,10 @@ static void BroadcastNewHistoryTable(base::SharedMemory* table_memory) { continue; base::SharedMemoryHandle new_table; - HANDLE process = i->second->process().handle(); + base::ProcessHandle process = i->second->process().handle(); if (!process) { // process can be null if it's started with the --single-process flag. - process = GetCurrentProcess(); + process = base::Process::Current().handle(); } table_memory->ShareToProcess(process, &new_table); @@ -484,7 +502,7 @@ UserScriptMaster* ProfileImpl::GetUserScriptMaster() { PrefService* ProfileImpl::GetPrefs() { if (!prefs_.get()) { - prefs_.reset(new PrefService(GetPrefFilePath())); + prefs_.reset(new PrefService(GetPrefFilePath().ToWStringHack())); // The Profile class and ProfileManager class may read some prefs so // register known prefs as soon as possible. @@ -504,18 +522,18 @@ PrefService* ProfileImpl::GetPrefs() { return prefs_.get(); } -std::wstring ProfileImpl::GetPrefFilePath() { - std::wstring pref_file_path = path_; - file_util::AppendToPath(&pref_file_path, chrome::kPreferencesFilename); +FilePath ProfileImpl::GetPrefFilePath() { + FilePath pref_file_path = path_; + pref_file_path = pref_file_path.Append(chrome::kPreferencesFilename); return pref_file_path; } URLRequestContext* ProfileImpl::GetRequestContext() { if (!request_context_) { - std::wstring cookie_path = GetPath(); - file_util::AppendToPath(&cookie_path, chrome::kCookieFilename); - std::wstring cache_path = GetPath(); - file_util::AppendToPath(&cache_path, chrome::kCacheDirname); + FilePath cookie_path = GetPath(); + cookie_path = cookie_path.Append(chrome::kCookieFilename); + FilePath cache_path = GetPath(); + cache_path = cache_path.Append(chrome::kCacheDirname); request_context_ = ChromeURLRequestContext::CreateOriginal( this, cookie_path, cache_path); request_context_->AddRef(); diff --git a/chrome/browser/profile.h b/chrome/browser/profile.h index 2ef3eff..7189577 100644 --- a/chrome/browser/profile.h +++ b/chrome/browser/profile.h @@ -11,6 +11,7 @@ #include <string> #include "base/basictypes.h" +#include "base/file_path.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "base/task.h" @@ -44,7 +45,7 @@ class Profile { // Profile services are accessed with the following parameter. This parameter // defines what the caller plans to do with the service. - // The caller is responsible for not performing any operation that would + // The caller is responsible for not performing any operation that would // result in persistent implicit records while using an OffTheRecord profile. // This flag allows the profile to perform an additional check. // @@ -74,7 +75,7 @@ class Profile { static void RegisterUserPrefs(PrefService* prefs); // Create a new profile given a path. - static Profile* CreateProfile(const std::wstring& path); + static Profile* CreateProfile(const FilePath& path); // Returns the request context for the "default" profile. This may be called // from any thread. This CAN return NULL if a first request context has not @@ -86,7 +87,7 @@ class Profile { static URLRequestContext* GetDefaultRequestContext(); // Returns the path of the directory where this profile's data is stored. - virtual std::wstring GetPath() = 0; + virtual FilePath GetPath() = 0; // Return whether this profile is off the record. Default is false. virtual bool IsOffTheRecord() = 0; @@ -117,6 +118,7 @@ class Profile { // Retrieves a pointer to the HistoryService associated with this // profile. The HistoryService is lazily created the first time // that this method is called. + // // Although HistoryService is refcounted, this will not addref, and callers // do not need to do any reference counting as long as they keep the pointer // only for the local scope (which they should do anyway since the browser @@ -258,7 +260,7 @@ class ProfileImpl : public Profile, virtual ~ProfileImpl(); // Profile implementation. - virtual std::wstring GetPath(); + virtual FilePath GetPath(); virtual bool IsOffTheRecord(); virtual Profile* GetOffTheRecordProfile(); virtual Profile* GetOriginalProfile(); @@ -301,10 +303,10 @@ class ProfileImpl : public Profile, private: friend class Profile; - explicit ProfileImpl(const std::wstring& path); + explicit ProfileImpl(const FilePath& path); void CreateWebDataService(); - std::wstring GetPrefFilePath(); + FilePath GetPrefFilePath(); void StopCreateSessionServiceTimer(); @@ -321,7 +323,7 @@ class ProfileImpl : public Profile, // spellchecker to the resource message filters. void InitializeSpellChecker(bool need_to_broadcast); - std::wstring path_; + FilePath path_; bool off_the_record_; scoped_ptr<VisitedLinkMaster> visited_link_master_; scoped_refptr<ExtensionsService> extensions_service_; diff --git a/chrome/browser/profile_manager.cc b/chrome/browser/profile_manager.cc index 6a2c139..7698f62 100644 --- a/chrome/browser/profile_manager.cc +++ b/chrome/browser/profile_manager.cc @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <windows.h> - #include <set> #include "chrome/browser/profile_manager.h" @@ -14,7 +12,6 @@ #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" -#include "chrome/browser/tab_contents/navigation_controller.h" #include "chrome/browser/chrome_thread.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" @@ -22,11 +19,18 @@ #include "chrome/common/logging_chrome.h" #include "chrome/common/pref_names.h" #include "chrome/common/pref_service.h" +#include "net/url_request/url_request_context.h" #include "net/url_request/url_request_job.h" #include "net/url_request/url_request_job_tracker.h" #include "generated_resources.h" +#if defined(OS_POSIX) +// TODO(port): get rid of this include. It's used just to provide declarations +// and stub definitions for classes we encouter during the porting effort. +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + // static void ProfileManager::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterStringPref(prefs::kProfileName, L""); @@ -68,23 +72,24 @@ ProfileManager::~ProfileManager() { available_profiles_.clear(); } -std::wstring ProfileManager::GetDefaultProfileDir( - const std::wstring& user_data_dir) { - std::wstring default_profile_dir(user_data_dir); - file_util::AppendToPath(&default_profile_dir, chrome::kNotSignedInProfile); +FilePath ProfileManager::GetDefaultProfileDir( + const FilePath& user_data_dir) { + FilePath default_profile_dir(user_data_dir); + default_profile_dir = default_profile_dir.Append( + FilePath::FromWStringHack(chrome::kNotSignedInProfile)); return default_profile_dir; } -std::wstring ProfileManager::GetDefaultProfilePath( - const std::wstring &profile_dir) { - std::wstring default_prefs_path(profile_dir); - file_util::AppendToPath(&default_prefs_path, chrome::kPreferencesFilename); +FilePath ProfileManager::GetDefaultProfilePath( + const FilePath &profile_dir) { + FilePath default_prefs_path(profile_dir); + default_prefs_path = default_prefs_path.Append(chrome::kPreferencesFilename); return default_prefs_path; } -Profile* ProfileManager::GetDefaultProfile(const std::wstring& user_data_dir) { +Profile* ProfileManager::GetDefaultProfile(const FilePath& user_data_dir) { // Initialize profile, creating default if necessary - std::wstring default_profile_dir = GetDefaultProfileDir(user_data_dir); + FilePath default_profile_dir = GetDefaultProfileDir(user_data_dir); // If the profile is already loaded (e.g., chrome.exe launched twice), just // return it. Profile* profile = GetProfileByPath(default_profile_dir); @@ -118,7 +123,7 @@ Profile* ProfileManager::GetDefaultProfile(const std::wstring& user_data_dir) { return profile; } -Profile* ProfileManager::AddProfileByPath(const std::wstring& path) { +Profile* ProfileManager::AddProfileByPath(const FilePath& path) { Profile* profile = GetProfileByPath(path); if (profile) return profile; @@ -143,9 +148,9 @@ Profile* ProfileManager::AddProfileByID(const std::wstring& id) { if (!available) return NULL; - std::wstring path; + FilePath path; PathService::Get(chrome::DIR_USER_DATA, &path); - file_util::AppendToPath(&path, available->directory()); + path = path.Append(available->directory()); return AddProfileByPath(path); } @@ -169,7 +174,8 @@ bool ProfileManager::AddProfile(Profile* profile) { // that's already loaded. if (GetProfileByPath(profile->GetPath())) { NOTREACHED() << "Attempted to add profile with the same path (" << - profile->GetPath() << ") as an already-loaded profile."; + profile->GetPath().value() << + ") as an already-loaded profile."; return false; } if (GetProfileByID(profile->GetID())) { @@ -192,7 +198,7 @@ void ProfileManager::RemoveProfile(Profile* profile) { } } -void ProfileManager::RemoveProfileByPath(const std::wstring& path) { +void ProfileManager::RemoveProfileByPath(const FilePath& path) { for (ProfileVector::iterator iter = profiles_.begin(); iter != profiles_.end(); ++iter) { if ((*iter)->GetPath() == path) { @@ -202,10 +208,10 @@ void ProfileManager::RemoveProfileByPath(const std::wstring& path) { } } - NOTREACHED() << "Attempted to remove non-loaded profile: " << path; + NOTREACHED() << "Attempted to remove non-loaded profile: " << path.value(); } -Profile* ProfileManager::GetProfileByPath(const std::wstring& path) const { +Profile* ProfileManager::GetProfileByPath(const FilePath& path) const { for (ProfileVector::const_iterator iter = profiles_.begin(); iter != profiles_.end(); ++iter) { if ((*iter)->GetPath() == path) @@ -268,66 +274,43 @@ void ProfileManager::ResumeProfile(Profile* profile) { // static -bool ProfileManager::IsProfile(const std::wstring& path) { - std::wstring prefs_path = GetDefaultProfilePath(path); +bool ProfileManager::IsProfile(const FilePath& path) { + FilePath prefs_path = GetDefaultProfilePath(path); - std::wstring history_path = path; - file_util::AppendToPath(&history_path, chrome::kHistoryFilename); + FilePath history_path = path; + history_path = history_path.Append(chrome::kHistoryFilename); return file_util::PathExists(prefs_path) && file_util::PathExists(history_path); } // static -bool ProfileManager::CopyProfileData(const std::wstring& source_path, - const std::wstring& destination_path) { +bool ProfileManager::CopyProfileData(const FilePath& source_path, + const FilePath& destination_path) { // create destination directory if necessary if (!file_util::PathExists(destination_path)) { - bool result = !!CreateDirectory(destination_path.c_str(), NULL); + bool result = file_util::CreateDirectory(destination_path); if (!result) { DLOG(WARNING) << "Unable to create destination directory " << - destination_path; + destination_path.value(); return false; } } // copy files in directory - WIN32_FIND_DATA find_file_data; - std::wstring filename_spec = source_path; - file_util::AppendToPath(&filename_spec, L"*"); - HANDLE find_handle = FindFirstFile(filename_spec.c_str(), &find_file_data); - if (find_handle != INVALID_HANDLE_VALUE) { - do { - // skip directories - if (find_file_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) - continue; - - std::wstring source_file = source_path; - file_util::AppendToPath(&source_file, find_file_data.cFileName); - std::wstring dest_file = destination_path; - file_util::AppendToPath(&dest_file, find_file_data.cFileName); - bool result = !!CopyFileW(source_file.c_str(), - dest_file.c_str(), - FALSE /* overwrite */); - if (!result) - return false; - } while (FindNextFile(find_handle, &find_file_data)); - FindClose(find_handle); - } - - return true; + return file_util::CopyDirectory(source_path, destination_path, false); } // static -Profile* ProfileManager::CreateProfile(const std::wstring& path, +Profile* ProfileManager::CreateProfile(const FilePath& path, const std::wstring& name, const std::wstring& nickname, const std::wstring& id) { DCHECK_LE(nickname.length(), name.length()); if (IsProfile(path)) { - DCHECK(false) << "Attempted to create a profile with the path:\n" << path - << "\n but that path already contains a profile"; + DCHECK(false) << "Attempted to create a profile with the path:\n" + << path.value() << "\n but that path already contains a profile"; } if (!file_util::PathExists(path)) { diff --git a/chrome/browser/profile_manager.h b/chrome/browser/profile_manager.h index 72f1d63..3735492 100644 --- a/chrome/browser/profile_manager.h +++ b/chrome/browser/profile_manager.h @@ -12,6 +12,7 @@ #include <vector> #include "base/basictypes.h" +#include "base/file_path.h" #include "base/message_loop.h" #include "base/non_thread_safe.h" #include "base/system_monitor.h" @@ -26,17 +27,18 @@ class AvailableProfile { public: AvailableProfile(const std::wstring& name, const std::wstring& id, - const std::wstring& directory) + const FilePath& directory) : name_(name), id_(id), directory_(directory) {} // Decodes a DictionaryValue into an AvailableProfile static AvailableProfile* FromValue(DictionaryValue* value) { DCHECK(value); - std::wstring name, id, directory; + std::wstring name, id; + FilePath::StringType directory; value->GetString(L"name", &name); value->GetString(L"id", &id); value->GetString(L"directory", &directory); - return new AvailableProfile(name, id, directory); + return new AvailableProfile(name, id, FilePath(directory)); } // Encodes this AvailableProfile into a new DictionaryValue @@ -44,18 +46,18 @@ class AvailableProfile { DictionaryValue* value = new DictionaryValue; value->SetString(L"name", name_); value->SetString(L"id", id_); - value->SetString(L"directory", directory_); + value->SetString(L"directory", directory_.value()); return value; } std::wstring name() const { return name_; } std::wstring id() const { return id_; } - std::wstring directory() const { return directory_; } + FilePath directory() const { return directory_; } private: - std::wstring name_; // User-visible profile name - std::wstring id_; // Profile identifier - std::wstring directory_; // Subdirectory containing profile (not full path) + std::wstring name_; // User-visible profile name + std::wstring id_; // Profile identifier + FilePath directory_; // Subdirectory containing profile (not full path) DISALLOW_EVIL_CONSTRUCTORS(AvailableProfile); }; @@ -75,12 +77,12 @@ class ProfileManager : public NonThreadSafe, // Returns the default profile. This adds the profile to the // ProfileManager if it doesn't already exist. This method returns NULL if // the profile doesn't exist and we can't create it. - Profile* GetDefaultProfile(const std::wstring& user_data_dir); + Profile* GetDefaultProfile(const FilePath& user_data_dir); // If a profile with the given path is currently managed by this object, // return a pointer to the corresponding Profile object; // otherwise return NULL. - Profile* GetProfileByPath(const std::wstring& path) const; + Profile* GetProfileByPath(const FilePath& path) const; // If a profile with the given ID is currently managed by this object, // return a pointer to the corresponding Profile object; @@ -89,7 +91,7 @@ class ProfileManager : public NonThreadSafe, // Adds a profile to the set of currently-loaded profiles. Returns a // pointer to a Profile object corresponding to the given path. - Profile* AddProfileByPath(const std::wstring& path); + Profile* AddProfileByPath(const FilePath& path); // Adds a profile to the set of currently-loaded profiles. Returns a // pointer to a Profile object corresponding to the given profile ID. @@ -104,7 +106,7 @@ class ProfileManager : public NonThreadSafe, // Removes a profile from the set of currently-loaded profiles. The path must // be exactly the same (including case) as when GetProfileByPath was called. - void RemoveProfileByPath(const std::wstring& path); + void RemoveProfileByPath(const FilePath& path); // Removes a profile from the set of currently-loaded profiles. // (Does not delete the profile object.) @@ -134,26 +136,26 @@ class ProfileManager : public NonThreadSafe, // ------------------ static utility functions ------------------- // Returns the path to the profile directory based on the user data directory. - static std::wstring GetDefaultProfileDir(const std::wstring& user_data_dir); + static FilePath GetDefaultProfileDir(const FilePath& user_data_dir); // Returns the path to the profile given the user profile directory. - static std::wstring GetDefaultProfilePath(const std::wstring& profile_dir); + static FilePath GetDefaultProfilePath(const FilePath& profile_dir); // Tries to determine whether the given path represents a profile // directory, and returns true if it thinks it does. - static bool IsProfile(const std::wstring& path); + static bool IsProfile(const FilePath& path); // Tries to copy profile data from the source path to the destination path, // returning true if successful. - static bool CopyProfileData(const std::wstring& source_path, - const std::wstring& destination_path); + static bool CopyProfileData(const FilePath& source_path, + const FilePath& destination_path); // Creates a new profile at the specified path with the given name and ID. // |name| is the full-length human-readable name for the profile // |nickname| is a shorter name for the profile--can be empty string // This method should always return a valid Profile (i.e., should never // return NULL). - static Profile* CreateProfile(const std::wstring& path, + static Profile* CreateProfile(const FilePath& path, const std::wstring& name, const std::wstring& nickname, const std::wstring& id); diff --git a/chrome/browser/profile_manager_unittest.cc b/chrome/browser/profile_manager_unittest.cc index 8a7ed05..be505d0 100644 --- a/chrome/browser/profile_manager_unittest.cc +++ b/chrome/browser/profile_manager_unittest.cc @@ -12,18 +12,16 @@ #include "chrome/common/pref_service.h" #include "testing/gtest/include/gtest/gtest.h" -namespace { - class ProfileManagerTest : public testing::Test { protected: virtual void SetUp() { // Name a subdirectory of the temp directory. ASSERT_TRUE(PathService::Get(base::DIR_TEMP, &test_dir_)); - file_util::AppendToPath(&test_dir_, L"ProfileManagerTest"); + test_dir_ = test_dir_.Append(FILE_PATH_LITERAL("ProfileManagerTest")); // Create a fresh, empty copy of this directory. file_util::Delete(test_dir_, true); - CreateDirectory(test_dir_.c_str(), NULL); + file_util::CreateDirectory(test_dir_); } virtual void TearDown() { // Clean up test directory @@ -34,35 +32,33 @@ protected: MessageLoopForUI message_loop_; // the path to temporary directory used to contain the test operations - std::wstring test_dir_; -}; - + FilePath test_dir_; }; TEST_F(ProfileManagerTest, CopyProfileData) { - std::wstring source_path; + FilePath source_path; PathService::Get(chrome::DIR_TEST_DATA, &source_path); - file_util::AppendToPath(&source_path, L"profiles"); + source_path = source_path.Append(FILE_PATH_LITERAL("profiles")); ASSERT_FALSE(ProfileManager::IsProfile(source_path)); - file_util::AppendToPath(&source_path, L"sample"); + source_path = source_path.Append(FILE_PATH_LITERAL("sample")); ASSERT_TRUE(ProfileManager::IsProfile(source_path)); - std::wstring dest_path = test_dir_; - file_util::AppendToPath(&dest_path, L"profile_copy"); + FilePath dest_path = test_dir_; + dest_path = dest_path.Append(FILE_PATH_LITERAL("profile_copy")); ASSERT_FALSE(ProfileManager::IsProfile(dest_path)); ASSERT_TRUE(ProfileManager::CopyProfileData(source_path, dest_path)); ASSERT_TRUE(ProfileManager::IsProfile(dest_path)); } TEST_F(ProfileManagerTest, CreateProfile) { - std::wstring source_path; + FilePath source_path; PathService::Get(chrome::DIR_TEST_DATA, &source_path); - file_util::AppendToPath(&source_path, L"profiles"); - file_util::AppendToPath(&source_path, L"sample"); + source_path = source_path.Append(FILE_PATH_LITERAL("profiles")); + source_path = source_path.Append(FILE_PATH_LITERAL("sample")); - std::wstring dest_path = test_dir_; - file_util::AppendToPath(&dest_path, L"New Profile"); + FilePath dest_path = test_dir_; + dest_path = dest_path.Append(FILE_PATH_LITERAL("New Profile")); scoped_ptr<Profile> profile; diff --git a/chrome/browser/renderer_host/browser_render_process_host.cc b/chrome/browser/renderer_host/browser_render_process_host.cc index 1e1db05..b208e89 100644 --- a/chrome/browser/renderer_host/browser_render_process_host.cc +++ b/chrome/browser/renderer_host/browser_render_process_host.cc @@ -27,22 +27,11 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/cache_manager_host.h" #include "chrome/browser/extensions/user_script_master.h" -#if defined(OS_WIN) -#include "chrome/browser/history/history.h" -#else -// TODO(port): remove scaffolding, use history.h for both POSIX and WIN. -#include "chrome/common/temp_scaffolding_stubs.h" -#endif // !defined(OS_WIN) - #include "chrome/browser/plugin_service.h" +#include "chrome/browser/profile.h" #include "chrome/browser/renderer_host/render_widget_helper.h" #include "chrome/browser/renderer_host/renderer_security_policy.h" #include "chrome/browser/resource_message_filter.h" -#if defined(OS_MACOSX) -// TODO(port): Enable when we finish porting spellchecker to os x. -#else -#include "chrome/browser/spellchecker.h" -#endif // !defined(OS_WIN) #include "chrome/browser/visitedlink_master.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" @@ -60,6 +49,9 @@ // TODO(port): see comment by the only usage of RenderViewHost in this file. #include "chrome/browser/renderer_host/render_view_host.h" +#include "chrome/browser/history/history.h" +#include "chrome/browser/spellchecker.h" + // Once the above TODO is finished, then this block is all Windows-specific // files. #include "base/win_util.h" @@ -479,9 +471,9 @@ void BrowserRenderProcessHost::WidgetHidden() { } void BrowserRenderProcessHost::AddWord(const std::wstring& word) { -#if defined(OS_MACOSX) +#if !defined(OS_WIN) // TODO(port): reimplement when we get the spell checker up and running on - // OS X. + // other platforms. NOTIMPLEMENTED(); #else base::Thread* io_thread = g_browser_process->io_thread(); @@ -489,7 +481,7 @@ void BrowserRenderProcessHost::AddWord(const std::wstring& word) { io_thread->message_loop()->PostTask(FROM_HERE, NewRunnableMethod( profile()->GetSpellChecker(), &SpellChecker::AddWord, word)); } -#endif // !defined(OS_MACOSX) +#endif // !defined(OS_WIN) } base::ProcessHandle BrowserRenderProcessHost::GetRendererProcessHandle() { diff --git a/chrome/browser/resource_message_filter.cc b/chrome/browser/resource_message_filter.cc index 753590c..63ea64d 100644 --- a/chrome/browser/resource_message_filter.cc +++ b/chrome/browser/resource_message_filter.cc @@ -325,7 +325,7 @@ void ResourceMessageFilter::OnGetCookies(const GURL& url, } void ResourceMessageFilter::OnGetDataDir(std::wstring* data_dir) { - *data_dir = plugin_service_->GetChromePluginDataDir(); + *data_dir = plugin_service_->GetChromePluginDataDir().ToWStringHack(); } void ResourceMessageFilter::OnPluginMessage(const FilePath& plugin_path, diff --git a/chrome/browser/rlz/rlz.cc b/chrome/browser/rlz/rlz.cc index 33e9b59..5cd0a15 100644 --- a/chrome/browser/rlz/rlz.cc +++ b/chrome/browser/rlz/rlz.cc @@ -266,7 +266,8 @@ class DelayedInitTask : public Task { if (!PathService::Get(chrome::DIR_USER_DATA, &user_data_dir)) return false; ProfileManager* profile_manager = g_browser_process->profile_manager(); - Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); + Profile* profile = profile_manager-> + GetDefaultProfile(FilePath::FromWStringHack(user_data_dir)); if (!profile) return false; const TemplateURL* url_template = diff --git a/chrome/browser/safe_browsing/safe_browsing_service.cc b/chrome/browser/safe_browsing/safe_browsing_service.cc index 57d4697..b524f22 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service.cc @@ -58,8 +58,7 @@ void SafeBrowsingService::Initialize(MessageLoop* io_loop) { FilePath user_data_dir; PathService::Get(chrome::DIR_USER_DATA, &user_data_dir); ProfileManager* profile_manager = g_browser_process->profile_manager(); - Profile* profile = profile_manager->GetDefaultProfile( - user_data_dir.ToWStringHack()); + Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); PrefService* pref_service = profile->GetPrefs(); if (pref_service->GetBoolean(prefs::kSafeBrowsingEnabled)) Start(); diff --git a/chrome/browser/search_engines/template_url.cc b/chrome/browser/search_engines/template_url.cc index 27bfe1d..9c2959a5 100644 --- a/chrome/browser/search_engines/template_url.cc +++ b/chrome/browser/search_engines/template_url.cc @@ -9,11 +9,21 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/rlz/rlz.h" #include "chrome/browser/google_url_tracker.h" -#include "chrome/browser/search_engines/template_url_model.h" #include "chrome/common/gfx/favicon_size.h" #include "chrome/common/l10n_util.h" #include "net/base/escape.h" +#if defined(OS_POSIX) +// TODO(port): get rid of this include. It's used just to provide declarations +// and stub definitions for classes we encouter during the porting effort. +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + +// TODO(port): Get rid of this section and finish porting. +#if defined(OS_WIN) +#include "chrome/browser/search_engines/template_url_model.h" +#endif + // The TemplateURLRef has any number of terms that need to be replaced. Each of // the terms is enclosed in braces. If the character preceeding the final // brace is a ?, it indicates the term is optional and can be replaced with diff --git a/chrome/browser/search_engines/template_url_model_unittest.cc b/chrome/browser/search_engines/template_url_model_unittest.cc index 9bad770..c633a19 100644 --- a/chrome/browser/search_engines/template_url_model_unittest.cc +++ b/chrome/browser/search_engines/template_url_model_unittest.cc @@ -49,7 +49,7 @@ class TemplateURLModelTestingProfile : public TestingProfile { std::wstring path = test_dir_; file_util::AppendToPath(&path, L"TestDataService.db"); service_ = new WebDataService; - EXPECT_TRUE(service_->InitWithPath(path)); + EXPECT_TRUE(service_->InitWithPath(FilePath::FromWStringHack(path))); } void TearDown() { diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc index 4bb9101..bf21c63 100644 --- a/chrome/browser/sessions/base_session_service.cc +++ b/chrome/browser/sessions/base_session_service.cc @@ -73,7 +73,8 @@ BaseSessionService::BaseSessionService(SessionType type, // We should never be created when off the record. DCHECK(!profile->IsOffTheRecord()); } - backend_ = new SessionBackend(type, profile_ ? profile_->GetPath() : path_); + backend_ = new SessionBackend(type, + profile_ ? profile_->GetPath().ToWStringHack() : path_); DCHECK(backend_.get()); backend_thread_ = g_browser_process->file_thread(); if (!backend_thread_) diff --git a/chrome/browser/spellchecker.h b/chrome/browser/spellchecker.h index ef36372..6d59a2d 100644 --- a/chrome/browser/spellchecker.h +++ b/chrome/browser/spellchecker.h @@ -9,12 +9,7 @@ #include "base/string_util.h" #include "chrome/browser/browser_process.h" -#if defined(OS_WIN) #include "chrome/browser/profile.h" -#else -// TODO(port): remove scaffolding, use profile.h for both POSIX and WIN. -#include "chrome/common/temp_scaffolding_stubs.h" -#endif #include "chrome/browser/spellcheck_worditerator.h" #include "chrome/common/l10n_util.h" #include "chrome/common/pref_names.h" diff --git a/chrome/browser/tabs/tab_strip_model_unittest.cc b/chrome/browser/tabs/tab_strip_model_unittest.cc index ef536a0..38467b0 100644 --- a/chrome/browser/tabs/tab_strip_model_unittest.cc +++ b/chrome/browser/tabs/tab_strip_model_unittest.cc @@ -105,7 +105,8 @@ class TabStripModelTest : public testing::Test { profile_path_ = test_dir_; file_util::AppendToPath(&profile_path_, L"New Profile"); - profile_ = ProfileManager::CreateProfile(profile_path_, + profile_ = ProfileManager::CreateProfile( + FilePath::FromWStringHack(profile_path_), L"New Profile", L"new-profile", L""); ASSERT_TRUE(profile_); pm_.AddProfile(profile_); @@ -115,7 +116,7 @@ class TabStripModelTest : public testing::Test { TabContents::RegisterFactory(kHTTPTabContentsType, NULL); // Removes a profile from the set of currently-loaded profiles. - pm_.RemoveProfileByPath(profile_path_); + pm_.RemoveProfileByPath(FilePath::FromWStringHack(profile_path_)); // Clean up test directory ASSERT_TRUE(file_util::Delete(test_dir_, true)); diff --git a/chrome/browser/visitedlink_master.cc b/chrome/browser/visitedlink_master.cc index 9cbe290..e24f80c 100644 --- a/chrome/browser/visitedlink_master.cc +++ b/chrome/browser/visitedlink_master.cc @@ -23,12 +23,12 @@ #include "base/string_util.h" #include "base/thread.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/profile.h" #if defined(OS_WIN) #include "chrome/browser/history/history.h" -#include "chrome/browser/profile.h" #else -// TODO(port): We should be using history.h & profile.h, remove scaffolding -// when those are ported. +// TODO(port): We should be using history.h, remove scaffolding +// when it is ported. #include "chrome/common/temp_scaffolding_stubs.h" #endif // !defined(OS_WIN) #if defined(OS_WIN) @@ -686,7 +686,7 @@ bool VisitedLinkMaster::GetDatabaseFileName(FilePath* filename) { if (!profile_ || profile_->GetPath().empty()) return false; - FilePath profile_dir = FilePath::FromWStringHack(profile_->GetPath()); + FilePath profile_dir = profile_->GetPath(); *filename = profile_dir.Append(FILE_PATH_LITERAL("Visited Links")); return true; } diff --git a/chrome/browser/visitedlink_unittest.cc b/chrome/browser/visitedlink_unittest.cc index 2dac97f..5b3928a 100644 --- a/chrome/browser/visitedlink_unittest.cc +++ b/chrome/browser/visitedlink_unittest.cc @@ -50,7 +50,7 @@ class VisitedLinkTest : public testing::Test { // Initialize the history system. This should be called before InitVisited(). bool InitHistory() { history_service_ = new HistoryService; - return history_service_->Init(history_dir_.ToWStringHack(), NULL); + return history_service_->Init(history_dir_, NULL); } // Initializes the visited link objects. Pass in the size that you want a diff --git a/chrome/browser/webdata/web_data_service.cc b/chrome/browser/webdata/web_data_service.cc index ced5a6f..da430af 100644 --- a/chrome/browser/webdata/web_data_service.cc +++ b/chrome/browser/webdata/web_data_service.cc @@ -32,13 +32,13 @@ WebDataService::~WebDataService() { } } -bool WebDataService::Init(const std::wstring& profile_path) { - std::wstring path = profile_path; - file_util::AppendToPath(&path, chrome::kWebDataFilename); +bool WebDataService::Init(const FilePath& profile_path) { + FilePath path = profile_path; + path = path.Append(chrome::kWebDataFilename); return InitWithPath(path); } -bool WebDataService::InitWithPath(const std::wstring& path) { +bool WebDataService::InitWithPath(const FilePath& path) { thread_ = new base::Thread("Chrome_WebDataThread"); if (!thread_->Start()) { @@ -384,14 +384,14 @@ void WebDataService::Commit() { } } -void WebDataService::InitializeDatabase(const std::wstring& path) { +void WebDataService::InitializeDatabase(const FilePath& path) { DCHECK(!db_); // In the rare case where the db fails to initialize a dialog may get shown // the blocks the caller, yet allows other messages through. For this reason // we only set db_ to the created database if creation is successful. That // way other methods won't do anything as db_ is still NULL. WebDatabase* db = new WebDatabase(); - if (!db->Init(path)) { + if (!db->Init(path.ToWStringHack())) { NOTREACHED() << "Cannot initialize the web database"; delete db; return; diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h index 4e2786b..e7a8e6d 100644 --- a/chrome/browser/webdata/web_data_service.h +++ b/chrome/browser/webdata/web_data_service.h @@ -20,6 +20,7 @@ struct IE7PasswordInfo; #endif struct PasswordForm; +class FilePath; class GURL; class ShutdownTask; class TemplateURL; @@ -143,7 +144,7 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { // Initializes the web data service. Returns false on failure // Takes the path of the profile directory as its argument. - bool Init(const std::wstring& profile_path); + bool Init(const FilePath& profile_path); // Shutdown the web data service. The service can no longer be used after this // call. @@ -387,7 +388,7 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { friend class WebDataRequest; // This is invoked by the unit test; path is the path of the Web Data file. - bool InitWithPath(const std::wstring& path); + bool InitWithPath(const FilePath& path); // Invoked by request implementations when a request has been processed. void RequestCompleted(Handle h); @@ -407,7 +408,7 @@ class WebDataService : public base::RefCountedThreadSafe<WebDataService> { std::vector<TemplateURL*> > SetKeywordsRequest; // Initialize the database with the provided path. - void InitializeDatabase(const std::wstring& path); + void InitializeDatabase(const FilePath& path); // Commit any pending transaction and deletes the database. void ShutdownDatabase(); diff --git a/chrome/browser/webdata/web_database.cc b/chrome/browser/webdata/web_database.cc index 83fa217..7d5b524 100755 --- a/chrome/browser/webdata/web_database.cc +++ b/chrome/browser/webdata/web_database.cc @@ -13,13 +13,26 @@ #include "base/string_util.h" #include "base/time.h" #include "base/values.h" -#include "chrome/browser/history/history_database.h" -#include "chrome/browser/password_manager/encryptor.h" #include "chrome/browser/search_engines/template_url.h" #include "chrome/common/l10n_util.h" #include "chrome/common/scoped_vector.h" #include "webkit/glue/password_form.h" +#if defined(OS_POSIX) +// TODO(port): get rid of this include. It's used just to provide declarations +// and stub definitions for classes we encouter during the porting effort. +#include "chrome/common/temp_scaffolding_stubs.h" +#endif + +// TODO(port): Get rid of this section and finish porting. +#if defined(OS_WIN) +// Encryptor is the *wrong* way of doing things; we need to turn it into a +// bottleneck to use the platform methods (e.g. Keychain on the Mac). That's +// going to take a massive change in its API... +#include "chrome/browser/history/history_database.h" +#include "chrome/browser/password_manager/encryptor.h" +#endif + //////////////////////////////////////////////////////////////////////////////// // // Schema diff --git a/chrome/chrome.xcodeproj/project.pbxproj b/chrome/chrome.xcodeproj/project.pbxproj index ddc00c1..e923bfe 100644 --- a/chrome/chrome.xcodeproj/project.pbxproj +++ b/chrome/chrome.xcodeproj/project.pbxproj @@ -78,7 +78,6 @@ 3380A69B0F2E91AE004EF74F /* child_process.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFB890E9D4C9F009A6919 /* child_process.cc */; }; 3380A69D0F2E91D4004EF74F /* render_thread.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D640CD10EAE868600EBCFC0 /* render_thread.cc */; }; 3380A69F0F2E91E5004EF74F /* chrome_plugin_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFB920E9D4C9F009A6919 /* chrome_plugin_lib.cc */; }; - 3380A6A00F2E91E7004EF74F /* chrome_plugin_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFB920E9D4C9F009A6919 /* chrome_plugin_lib.cc */; }; 3380A6A10F2E91F9004EF74F /* render_process.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D640CCF0EAE868600EBCFC0 /* render_process.cc */; }; 3380A6A30F2E9207004EF74F /* ipc_sync_channel.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBB60E9D4C9F009A6919 /* ipc_sync_channel.cc */; }; 3380A6B60F2E9252004EF74F /* render_thread_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3380A6B50F2E9252004EF74F /* render_thread_unittest.cc */; }; @@ -202,8 +201,28 @@ 4DCE9E2D0EF0B8C000682526 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 4DCE9E2B0EF0B8C000682526 /* MainMenu.xib */; }; 4DDC644B0EAE390800FB5EBE /* libxml.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7BFB230E9D4BBF009A6919 /* libxml.a */; }; 4DDC64580EAE394200FB5EBE /* libzlib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DDC64550EAE392400FB5EBE /* libzlib.a */; }; + 8268477E0F2F69C8009F6555 /* profile_manager_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF8E60E9D4839009A6919 /* profile_manager_unittest.cc */; }; + 8268477F0F2F69D1009F6555 /* profile_manager.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF8E40E9D4839009A6919 /* profile_manager.cc */; }; + 826847800F2F69D1009F6555 /* profile.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF8E20E9D4839009A6919 /* profile.cc */; }; + 82684C490F2FADD6009F6555 /* libsqlite.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7B01410E9D56BC009A6919 /* libsqlite.a */; }; + 82684C510F2FAE06009F6555 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D1F5AB60F2A6EE90040C1E3 /* libpng.a */; }; + 82684C600F2FAE68009F6555 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82684C5F0F2FAE68009F6555 /* Security.framework */; }; + 82684CCB0F2FAE90009F6555 /* libzlib.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4DDC64550EAE392400FB5EBE /* libzlib.a */; }; + 82684CD00F2FAEC2009F6555 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82684CCF0F2FAEC2009F6555 /* SystemConfiguration.framework */; }; + 82684CE30F2FAEEE009F6555 /* libbzip2.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7BFF540E9D53C1009A6919 /* libbzip2.a */; }; + 82684D0B0F2FB104009F6555 /* libsdch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 82684D0A0F2FB101009F6555 /* libsdch.a */; }; + 82684FEB0F2FC650009F6555 /* template_url.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3CCF8AA8A56FF8FE59F0C299 /* template_url.cc */; }; + 826852120F2FD143009F6555 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82684C5F0F2FAE68009F6555 /* Security.framework */; }; + 826852130F2FD146009F6555 /* libpng.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D1F5AB60F2A6EE90040C1E3 /* libpng.a */; }; + 826852160F2FD156009F6555 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 82684CCF0F2FAEC2009F6555 /* SystemConfiguration.framework */; }; + 826852180F2FD188009F6555 /* tab_contents_controller.mm in Sources */ = {isa = PBXBuildFile; fileRef = E46C50E90F2A11FC00B393B8 /* tab_contents_controller.mm */; }; + 826852190F2FD190009F6555 /* libsdch.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 82684D0A0F2FB101009F6555 /* libsdch.a */; }; + 826853320F30ADF5009F6555 /* child_process.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFB890E9D4C9F009A6919 /* child_process.cc */; }; + 826853350F30AE04009F6555 /* render_thread.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D640CD10EAE868600EBCFC0 /* render_thread.cc */; }; + 826853380F30AE0C009F6555 /* chrome_plugin_lib.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFB920E9D4C9F009A6919 /* chrome_plugin_lib.cc */; }; + 8268533B0F30AE13009F6555 /* render_process.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D640CCF0EAE868600EBCFC0 /* render_process.cc */; }; + 8268533F0F30AE1C009F6555 /* ipc_sync_channel.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BFBB60E9D4C9F009A6919 /* ipc_sync_channel.cc */; }; 8F51B73AAAF1772ECF9BD180 /* url_fetcher.cc in Sources */ = {isa = PBXBuildFile; fileRef = 778D7927798B7E3FAA498D3D /* url_fetcher.cc */; }; - 9A1EE0F9187ACE2DCB8512E1 /* template_url.cc in Sources */ = {isa = PBXBuildFile; fileRef = 3CCF8AA8A56FF8FE59F0C299 /* template_url.cc */; }; A54612DC0EE9958600A8EE5D /* extensions_service_unittest.cc in Sources */ = {isa = PBXBuildFile; fileRef = A54612DB0EE9958600A8EE5D /* extensions_service_unittest.cc */; }; A54612E20EE995F600A8EE5D /* extensions_service.cc in Sources */ = {isa = PBXBuildFile; fileRef = A54612D90EE9957000A8EE5D /* extensions_service.cc */; }; A76E43A40F29039C009A7E88 /* browser_render_process_host.cc in Sources */ = {isa = PBXBuildFile; fileRef = A76E43A30F29039C009A7E88 /* browser_render_process_host.cc */; }; @@ -242,7 +261,6 @@ B5FDC2180EE48F4100BEC6E6 /* libicui18n.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4D7BFE6D0E9D52DC009A6919 /* libicui18n.a */; }; B6CCB9FA0F1EC33100106F0D /* provisional_load_details.cc in Sources */ = {isa = PBXBuildFile; fileRef = B6CCB9DE0F1EC32700106F0D /* provisional_load_details.cc */; }; B9BF55F87A4BB2FD366B6DDC /* template_url_parser.cc in Sources */ = {isa = PBXBuildFile; fileRef = 28AA584AB2ECFB33C7C7FD8A /* template_url_parser.cc */; }; - C39F08C4FFD9C2F98384F56B /* template_url_model.cc in Sources */ = {isa = PBXBuildFile; fileRef = EA72C084DB3FC0FC595E525E /* template_url_model.cc */; }; E40CC5E30F2E348900708647 /* history_contents_provider.cc in Sources */ = {isa = PBXBuildFile; fileRef = E40CC5E10F2E348900708647 /* history_contents_provider.cc */; }; E40CC5EE0F2E34C100708647 /* base_history_model.cc in Sources */ = {isa = PBXBuildFile; fileRef = 4D7BF82B0E9D4839009A6919 /* base_history_model.cc */; }; E40CC5F20F2E34EE00708647 /* bookmark_folder_tree_model.cc in Sources */ = {isa = PBXBuildFile; fileRef = E40CC5F00F2E34EE00708647 /* bookmark_folder_tree_model.cc */; }; @@ -911,6 +929,153 @@ remoteGlobalIDString = D2AAC045055464E500DB518D; remoteInfo = zlib; }; + 82684C4A0F2FADE4009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4D7B01390E9D56BC009A6919 /* sqlite.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 4D7B007E0E9D5538009A6919; + remoteInfo = sqlite; + }; + 82684C520F2FAE10009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4D1F5AB10F2A6EE90040C1E3 /* libpng.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC045055464E500DB518D; + remoteInfo = libpng; + }; + 82684CCC0F2FAE97009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4DDC64500EAE392400FB5EBE /* zlib.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC045055464E500DB518D; + remoteInfo = zlib; + }; + 82684CE40F2FAEF4009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4D7BFF4C0E9D53C1009A6919 /* bzip2.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC045055464E500DB518D; + remoteInfo = bzip2; + }; + 82684D090F2FB101009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 82684D050F2FB101009F6555 /* sdch.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 7BA361A70E8C36E50023C8B9; + remoteInfo = sdch; + }; + 82684D0C0F2FB10F009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 82684D050F2FB101009F6555 /* sdch.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 7BA361A60E8C36E50023C8B9; + remoteInfo = sdch; + }; + 826850170F2FC82E009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 826850040F2FC82D009F6555 /* webkit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E45627150E268F03005E4685; + remoteInfo = glue; + }; + 826850190F2FC82E009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 826850040F2FC82D009F6555 /* webkit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 7BFD8E660DAFE7630084BC4B; + remoteInfo = jsbindings; + }; + 8268501B0F2FC82E009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 826850040F2FC82D009F6555 /* webkit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 7B27489D0E43815F009BCE03; + remoteInfo = pcre; + }; + 8268501D0F2FC82E009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 826850040F2FC82D009F6555 /* webkit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E45627F40E2694B8005E4685; + remoteInfo = port; + }; + 8268501F0F2FC82E009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 826850040F2FC82D009F6555 /* webkit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = E45626950E268E87005E4685; + remoteInfo = webcore; + }; + 826850210F2FC82E009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 826850040F2FC82D009F6555 /* webkit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4DB7FE6F0E9BF6AC00C66CE0; + remoteInfo = webcoresysteminterface; + }; + 826850230F2FC82E009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 826850040F2FC82D009F6555 /* webkit.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 7B5E85AE0D7F28CD001ECF42; + remoteInfo = wtf; + }; + 8268504A0F2FCB56009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8268503E0F2FCB56009F6555 /* v8.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 897FF1BF0E719CB600D62E90; + remoteInfo = jscre; + }; + 8268504C0F2FCB56009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8268503E0F2FCB56009F6555 /* v8.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 8970F2F00E719FB2006AE7B5; + remoteInfo = v8; + }; + 8268504E0F2FCB56009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8268503E0F2FCB56009F6555 /* v8.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 897F767A0E71B4CC007ACF34; + remoteInfo = v8_shell; + }; + 826850500F2FCB56009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8268503E0F2FCB56009F6555 /* v8.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 89F23C870E78D5B2006B2466; + remoteInfo = "v8-arm"; + }; + 826850520F2FCB56009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 8268503E0F2FCB56009F6555 /* v8.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 89F23C950E78D5B6006B2466; + remoteInfo = "v8_shell-arm"; + }; + 826850690F2FCC27009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 826850600F2FCC27009F6555 /* libxslt.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 4DB684930EAFDF7000AB2128; + remoteInfo = xslt; + }; + 826852140F2FD152009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 4D1F5AB10F2A6EE90040C1E3 /* libpng.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = D2AAC045055464E500DB518D; + remoteInfo = libpng; + }; + 8268521A0F2FD197009F6555 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 82684D050F2FB101009F6555 /* sdch.xcodeproj */; + proxyType = 1; + remoteGlobalIDString = 7BA361A60E8C36E50023C8B9; + remoteInfo = sdch; + }; B503E1010F017BE300547DC6 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 4D7BF2E90E9D46A4009A6919 /* Project object */; @@ -1678,6 +1843,13 @@ 4DCE9E2C0EF0B8C000682526 /* English */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = English; path = English.lproj/MainMenu.xib; sourceTree = "<group>"; }; 4DDC64500EAE392400FB5EBE /* zlib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = zlib.xcodeproj; path = third_party/zlib/zlib.xcodeproj; sourceTree = "<group>"; }; 778D7927798B7E3FAA498D3D /* url_fetcher.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = url_fetcher.cc; sourceTree = "<group>"; }; + 82684C5F0F2FAE68009F6555 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; + 82684CCF0F2FAEC2009F6555 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; + 82684D050F2FB101009F6555 /* sdch.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = sdch.xcodeproj; path = sdch/sdch.xcodeproj; sourceTree = "<group>"; }; + 826850040F2FC82D009F6555 /* webkit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = webkit.xcodeproj; path = webkit/webkit.xcodeproj; sourceTree = "<group>"; }; + 8268503E0F2FCB56009F6555 /* v8.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = v8.xcodeproj; path = build/v8.xcodeproj; sourceTree = "<group>"; }; + 826850600F2FCC27009F6555 /* libxslt.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = libxslt.xcodeproj; path = third_party/libxslt/libxslt.xcodeproj; sourceTree = "<group>"; }; + 826851480F2FCDEC009F6555 /* CoreServices.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreServices.framework; path = System/Library/Frameworks/CoreServices.framework; sourceTree = SDKROOT; }; A54612D90EE9957000A8EE5D /* extensions_service.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extensions_service.cc; sourceTree = "<group>"; }; A54612DA0EE9957000A8EE5D /* extensions_service.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = extensions_service.h; sourceTree = "<group>"; }; A54612DB0EE9958600A8EE5D /* extensions_service_unittest.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = extensions_service_unittest.cc; sourceTree = "<group>"; }; @@ -2028,11 +2200,15 @@ 4D7BFF3A0E9D5378009A6919 /* libjpeg.a in Frameworks */, 4D7B005E0E9D54BB009A6919 /* libmodp_b64.a in Frameworks */, 4D7B00510E9D5473009A6919 /* libnet.a in Frameworks */, + 826852130F2FD146009F6555 /* libpng.a in Frameworks */, B503E1030F017C1000547DC6 /* librenderer.a in Frameworks */, + 826852190F2FD190009F6555 /* libsdch.a in Frameworks */, 4D7B00520E9D5473009A6919 /* libskia.a in Frameworks */, 4D7B01420E9D56C4009A6919 /* libsqlite.a in Frameworks */, 4DDC644B0EAE390800FB5EBE /* libxml.a in Frameworks */, 4DDC64580EAE394200FB5EBE /* libzlib.a in Frameworks */, + 826852120F2FD143009F6555 /* Security.framework in Frameworks */, + 826852160F2FD156009F6555 /* SystemConfiguration.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2085,19 +2261,26 @@ files = ( E45065DE0EEEC6FF003BE099 /* AppKit.framework in Frameworks */, E45065E00EEEC709003BE099 /* Foundation.framework in Frameworks */, - E48B67320F2625B8002E47EC /* libgoogleurl.a in Frameworks */, E45062680EE890C2003BE099 /* libbase.a in Frameworks */, E48B67ED0F262823002E47EC /* libbase_gfx.a in Frameworks */, E45063130EE990A4003BE099 /* libbrowser.a in Frameworks */, + 82684CE30F2FAEEE009F6555 /* libbzip2.a in Frameworks */, E45063120EE99096003BE099 /* libcommon.a in Frameworks */, E450631C0EE990FA003BE099 /* libevent.a in Frameworks */, + E48B67320F2625B8002E47EC /* libgoogleurl.a in Frameworks */, E45062A90EE89154003BE099 /* libicudata.a in Frameworks */, E45062A70EE89146003BE099 /* libicui18n.a in Frameworks */, E45062AC0EE89154003BE099 /* libicuuc.a in Frameworks */, E48B67CB0F262607002E47EC /* libmodp_b64.a in Frameworks */, E48B66A80F26257E002E47EC /* libnet.a in Frameworks */, + 82684C510F2FAE06009F6555 /* libpng.a in Frameworks */, E45063140EE990AB003BE099 /* librenderer.a in Frameworks */, + 82684D0B0F2FB104009F6555 /* libsdch.a in Frameworks */, E48B67CF0F26263C002E47EC /* libskia.a in Frameworks */, + 82684C490F2FADD6009F6555 /* libsqlite.a in Frameworks */, + 82684CCB0F2FAE90009F6555 /* libzlib.a in Frameworks */, + 82684C600F2FAE68009F6555 /* Security.framework in Frameworks */, + 82684CD00F2FAEC2009F6555 /* SystemConfiguration.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2298,7 +2481,7 @@ 4D7BFA670E9D4981009A6919 /* net */, B5D16EA10F21444000861FAC /* password_manager */, 4D7BFA7E0E9D49A4009A6919 /* printing */, - E45075D80F150A3B003BE099 /* render_host */, + E45075D80F150A3B003BE099 /* renderer_host */, 4D7BFACD0E9D49DE009A6919 /* safe_browsing */, B5D16ED80F21455600861FAC /* search_engines */, E45075F00F150BEA003BE099 /* sessions */, @@ -2717,10 +2900,14 @@ 4D7BFF2F0E9D5362009A6919 /* libjpeg.xcodeproj */, 4D1F5AB10F2A6EE90040C1E3 /* libpng.xcodeproj */, 4D7BFB0B0E9D4BBF009A6919 /* libxml.xcodeproj */, + 826850600F2FCC27009F6555 /* libxslt.xcodeproj */, 4D7B00580E9D54AA009A6919 /* modp_b64.xcodeproj */, 4D7B00340E9D5464009A6919 /* net.xcodeproj */, + 82684D050F2FB101009F6555 /* sdch.xcodeproj */, 4D7B002E0E9D5459009A6919 /* skia.xcodeproj */, 4D7B01390E9D56BC009A6919 /* sqlite.xcodeproj */, + 8268503E0F2FCB56009F6555 /* v8.xcodeproj */, + 826850040F2FC82D009F6555 /* webkit.xcodeproj */, 4DDC64500EAE392400FB5EBE /* zlib.xcodeproj */, ); name = Projects; @@ -2973,9 +3160,12 @@ 4D7BFDD00E9D527E009A6919 /* Frameworks */ = { isa = PBXGroup; children = ( - E45065DF0EEEC709003BE099 /* Foundation.framework */, E45065DD0EEEC6FF003BE099 /* AppKit.framework */, 4D7BFDD10E9D5295009A6919 /* CoreFoundation.framework */, + 826851480F2FCDEC009F6555 /* CoreServices.framework */, + E45065DF0EEEC709003BE099 /* Foundation.framework */, + 82684C5F0F2FAE68009F6555 /* Security.framework */, + 82684CCF0F2FAEC2009F6555 /* SystemConfiguration.framework */, ); name = Frameworks; sourceTree = SDKROOT; @@ -3043,6 +3233,48 @@ name = Products; sourceTree = "<group>"; }; + 82684D060F2FB101009F6555 /* Products */ = { + isa = PBXGroup; + children = ( + 82684D0A0F2FB101009F6555 /* libsdch.a */, + ); + name = Products; + sourceTree = "<group>"; + }; + 826850050F2FC82D009F6555 /* Products */ = { + isa = PBXGroup; + children = ( + 826850180F2FC82E009F6555 /* libglue.a */, + 8268501A0F2FC82E009F6555 /* libjsbindings.a */, + 8268501C0F2FC82E009F6555 /* libpcre.a */, + 8268501E0F2FC82E009F6555 /* libport.a */, + 826850200F2FC82E009F6555 /* libwebcore.a */, + 826850220F2FC82E009F6555 /* libwebcoresysteminterface.a */, + 826850240F2FC82E009F6555 /* libwtf.a */, + ); + name = Products; + sourceTree = "<group>"; + }; + 8268503F0F2FCB56009F6555 /* Products */ = { + isa = PBXGroup; + children = ( + 8268504B0F2FCB56009F6555 /* libjscre.a */, + 8268504D0F2FCB56009F6555 /* libv8.a */, + 8268504F0F2FCB56009F6555 /* v8_shell */, + 826850510F2FCB56009F6555 /* libv8-arm.a */, + 826850530F2FCB56009F6555 /* v8_shell-arm */, + ); + name = Products; + sourceTree = "<group>"; + }; + 826850610F2FCC27009F6555 /* Products */ = { + isa = PBXGroup; + children = ( + 8268506A0F2FCC27009F6555 /* libxslt.a */, + ); + name = Products; + sourceTree = "<group>"; + }; B555B20F0F21503700F751B9 /* metrics */ = { isa = PBXGroup; children = ( @@ -3295,7 +3527,7 @@ name = importer; sourceTree = "<group>"; }; - E45075D80F150A3B003BE099 /* render_host */ = { + E45075D80F150A3B003BE099 /* renderer_host */ = { isa = PBXGroup; children = ( E45075DA0F150A53003BE099 /* async_resource_handler.cc */, @@ -3337,7 +3569,7 @@ E45075EA0F150ABA003BE099 /* sync_resource_handler.cc */, E45075EB0F150ABA003BE099 /* sync_resource_handler.h */, ); - name = render_host; + name = renderer_host; sourceTree = "<group>"; }; E45075F00F150BEA003BE099 /* sessions */ = { @@ -3550,6 +3782,8 @@ 4D7B01440E9D56CC009A6919 /* PBXTargetDependency */, 4DDC644A0EAE38F500FB5EBE /* PBXTargetDependency */, 4DDC64570EAE393800FB5EBE /* PBXTargetDependency */, + 826852150F2FD152009F6555 /* PBXTargetDependency */, + 8268521B0F2FD197009F6555 /* PBXTargetDependency */, ); name = unit_tests; productName = unit_tests; @@ -3650,6 +3884,11 @@ E450631A0EE990C4003BE099 /* PBXTargetDependency */, E46C4EB70F278A5900B393B8 /* PBXTargetDependency */, E46C4EBB0F278A7100B393B8 /* PBXTargetDependency */, + 82684C4B0F2FADE4009F6555 /* PBXTargetDependency */, + 82684C530F2FAE10009F6555 /* PBXTargetDependency */, + 82684CCD0F2FAE97009F6555 /* PBXTargetDependency */, + 82684CE50F2FAEF4009F6555 /* PBXTargetDependency */, + 82684D0D0F2FB10F009F6555 /* PBXTargetDependency */, ); name = app; productName = app; @@ -3705,6 +3944,10 @@ ProjectRef = 4D7BFB0B0E9D4BBF009A6919 /* libxml.xcodeproj */; }, { + ProductGroup = 826850610F2FCC27009F6555 /* Products */; + ProjectRef = 826850600F2FCC27009F6555 /* libxslt.xcodeproj */; + }, + { ProductGroup = 4D7B00590E9D54AA009A6919 /* Products */; ProjectRef = 4D7B00580E9D54AA009A6919 /* modp_b64.xcodeproj */; }, @@ -3713,6 +3956,10 @@ ProjectRef = 4D7B00340E9D5464009A6919 /* net.xcodeproj */; }, { + ProductGroup = 82684D060F2FB101009F6555 /* Products */; + ProjectRef = 82684D050F2FB101009F6555 /* sdch.xcodeproj */; + }, + { ProductGroup = 4D7B002F0E9D5459009A6919 /* Products */; ProjectRef = 4D7B002E0E9D5459009A6919 /* skia.xcodeproj */; }, @@ -3721,6 +3968,14 @@ ProjectRef = 4D7B01390E9D56BC009A6919 /* sqlite.xcodeproj */; }, { + ProductGroup = 8268503F0F2FCB56009F6555 /* Products */; + ProjectRef = 8268503E0F2FCB56009F6555 /* v8.xcodeproj */; + }, + { + ProductGroup = 826850050F2FC82D009F6555 /* Products */; + ProjectRef = 826850040F2FC82D009F6555 /* webkit.xcodeproj */; + }, + { ProductGroup = 4DDC64510EAE392400FB5EBE /* Products */; ProjectRef = 4DDC64500EAE392400FB5EBE /* zlib.xcodeproj */; }, @@ -3927,6 +4182,104 @@ remoteRef = 4DDC64540EAE392400FB5EBE /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 82684D0A0F2FB101009F6555 /* libsdch.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libsdch.a; + remoteRef = 82684D090F2FB101009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 826850180F2FC82E009F6555 /* libglue.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libglue.a; + remoteRef = 826850170F2FC82E009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8268501A0F2FC82E009F6555 /* libjsbindings.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libjsbindings.a; + remoteRef = 826850190F2FC82E009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8268501C0F2FC82E009F6555 /* libpcre.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libpcre.a; + remoteRef = 8268501B0F2FC82E009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8268501E0F2FC82E009F6555 /* libport.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libport.a; + remoteRef = 8268501D0F2FC82E009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 826850200F2FC82E009F6555 /* libwebcore.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libwebcore.a; + remoteRef = 8268501F0F2FC82E009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 826850220F2FC82E009F6555 /* libwebcoresysteminterface.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libwebcoresysteminterface.a; + remoteRef = 826850210F2FC82E009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 826850240F2FC82E009F6555 /* libwtf.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libwtf.a; + remoteRef = 826850230F2FC82E009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8268504B0F2FCB56009F6555 /* libjscre.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libjscre.a; + remoteRef = 8268504A0F2FCB56009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8268504D0F2FCB56009F6555 /* libv8.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libv8.a; + remoteRef = 8268504C0F2FCB56009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8268504F0F2FCB56009F6555 /* v8_shell */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = v8_shell; + remoteRef = 8268504E0F2FCB56009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 826850510F2FCB56009F6555 /* libv8-arm.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = "libv8-arm.a"; + remoteRef = 826850500F2FCB56009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 826850530F2FCB56009F6555 /* v8_shell-arm */ = { + isa = PBXReferenceProxy; + fileType = "compiled.mach-o.executable"; + path = "v8_shell-arm"; + remoteRef = 826850520F2FCB56009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; + 8268506A0F2FCC27009F6555 /* libxslt.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libxslt.a; + remoteRef = 826850690F2FCC27009F6555 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; /* End PBXReferenceProxy section */ /* Begin PBXResourcesBuildPhase section */ @@ -4192,6 +4545,8 @@ 4D7BF9AC0E9D4880009A6919 /* page_state.cc in Sources */, 4D7BFA280E9D490C009A6919 /* page_usage_data.cc in Sources */, E48B6C2C0F27840B002E47EC /* password_form_manager.cc in Sources */, + 826847800F2F69D1009F6555 /* profile.cc in Sources */, + 8268477F0F2F69D1009F6555 /* profile_manager.cc in Sources */, 4D7BFAF10E9D49EB009A6919 /* protocol_parser.cc in Sources */, B6CCB9FA0F1EC33100106F0D /* provisional_load_details.cc in Sources */, E4F324500EE5CF7C002533CE /* query_parser.cc in Sources */, @@ -4216,8 +4571,7 @@ E45075EE0F150ABA003BE099 /* sync_resource_handler.cc in Sources */, E46C53A40F2F660900B393B8 /* tab_strip_model.cc in Sources */, E46C53AA0F2F662F00B393B8 /* tab_strip_model_order_controller.cc in Sources */, - 9A1EE0F9187ACE2DCB8512E1 /* template_url.cc in Sources */, - C39F08C4FFD9C2F98384F56B /* template_url_model.cc in Sources */, + 82684FEB0F2FC650009F6555 /* template_url.cc in Sources */, B9BF55F87A4BB2FD366B6DDC /* template_url_parser.cc in Sources */, 4D7BFA320E9D4912009A6919 /* text_database.cc in Sources */, 4D7BFA370E9D4915009A6919 /* text_database_manager.cc in Sources */, @@ -4234,10 +4588,10 @@ E46C42130F1D3DD200B393B8 /* user_script_master.cc in Sources */, 4D7BFA3E0E9D491B009A6919 /* visit_database.cc in Sources */, 4D7BFA430E9D491E009A6919 /* visit_tracker.cc in Sources */, + B5FCDE5C0F269E9B0099BFAF /* visitedlink_master.cc in Sources */, 4D7BFA480E9D4922009A6919 /* visitsegment_database.cc in Sources */, E48B6C3C0F27844F002E47EC /* web_data_service.cc in Sources */, E45076200F150E0C003BE099 /* web_database.cc in Sources */, - B5FCDE5C0F269E9B0099BFAF /* visitedlink_master.cc in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -4248,15 +4602,16 @@ 4D7BFCDF0E9D4DC4009A6919 /* animation_unittest.cc in Sources */, 4D7BFB6D0E9D4C51009A6919 /* bloom_filter_unittest.cc in Sources */, 4D7BFCE10E9D4DC8009A6919 /* bzip2_unittest.cc in Sources */, - 3380A6A00F2E91E7004EF74F /* chrome_plugin_lib.cc in Sources */, + 826853320F30ADF5009F6555 /* child_process.cc in Sources */, + 826853380F30AE0C009F6555 /* chrome_plugin_lib.cc in Sources */, 4D7BFB350E9D4C18009A6919 /* chrome_thread_unittest.cc in Sources */, 4D7BFB710E9D4C55009A6919 /* chunk_range_unittest.cc in Sources */, E46C4EF30F27A9B000B393B8 /* command_updater_unittest.cc in Sources */, 4D7BFB510E9D4C3E009A6919 /* dns_host_info_unittest.cc in Sources */, E4F324950EE5D758002533CE /* extension_unittest.cc in Sources */, A54612DC0EE9958600A8EE5D /* extensions_service_unittest.cc in Sources */, - B503E0FC0F01764800547DC6 /* user_script_slave_unittest.cc in Sources */, 4D7BFB3C0E9D4C25009A6919 /* history_types_unittest.cc in Sources */, + 8268533F0F30AE1C009F6555 /* ipc_sync_channel.cc in Sources */, B507AC440F004B610060FEE8 /* ipc_sync_message_unittest.cc in Sources */, A7C6146F0F30DA1D008CEE5D /* ipc_test_sink.cc in Sources */, 4D7BFCE70E9D4DD4009A6919 /* json_value_serializer_unittest.cc in Sources */, @@ -4267,17 +4622,22 @@ E45077620F15405C003BE099 /* notification_service_unittest.cc in Sources */, 4D7BFB580E9D4C43009A6919 /* page_range_unittest.cc in Sources */, 4D7BFB5F0E9D4C46009A6919 /* page_setup_unittest.cc in Sources */, + 8268477E0F2F69C8009F6555 /* profile_manager_unittest.cc in Sources */, B562E2FC0F05845100FB1A4F /* property_bag_unittest.cc in Sources */, 4D7BFB780E9D4C5A009A6919 /* protocol_parser_unittest.cc in Sources */, 3380A9D60F2FC8F6004EF74F /* render_dns_master.cc in Sources */, + 8268533B0F30AE13009F6555 /* render_process.cc in Sources */, 3380A9C00F2FC61E004EF74F /* render_process_unittest.cc in Sources */, + 826853350F30AE04009F6555 /* render_thread.cc in Sources */, 3380A6B60F2E9252004EF74F /* render_thread_unittest.cc in Sources */, 4D7BFCF30E9D4E07009A6919 /* run_all_unittests.cc in Sources */, E48FB9870EC4EBA10052B72B /* safe_browsing_database_unittest.cc in Sources */, 4D7BFB7F0E9D4C63009A6919 /* safe_browsing_util_unittest.cc in Sources */, E4F324980EE5D7DE002533CE /* snippet_unittest.cc in Sources */, + 826852180F2FD188009F6555 /* tab_contents_controller.mm in Sources */, 4D7BFB3E0E9D4C2F009A6919 /* text_database_unittest.cc in Sources */, 4D7BFB610E9D4C4B009A6919 /* units_unittest.cc in Sources */, + B503E0FC0F01764800547DC6 /* user_script_slave_unittest.cc in Sources */, B502DA280F098056005BE90C /* visit_database_unittest.cc in Sources */, 4D7BFB420E9D4C35009A6919 /* visit_tracker_unittest.cc in Sources */, E46C4B4C0F21098F00B393B8 /* worker_thread_ticker_unittest.cc in Sources */, @@ -4607,6 +4967,41 @@ name = zlib; targetProxy = 4DDC64560EAE393800FB5EBE /* PBXContainerItemProxy */; }; + 82684C4B0F2FADE4009F6555 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = sqlite; + targetProxy = 82684C4A0F2FADE4009F6555 /* PBXContainerItemProxy */; + }; + 82684C530F2FAE10009F6555 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libpng; + targetProxy = 82684C520F2FAE10009F6555 /* PBXContainerItemProxy */; + }; + 82684CCD0F2FAE97009F6555 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = zlib; + targetProxy = 82684CCC0F2FAE97009F6555 /* PBXContainerItemProxy */; + }; + 82684CE50F2FAEF4009F6555 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = bzip2; + targetProxy = 82684CE40F2FAEF4009F6555 /* PBXContainerItemProxy */; + }; + 82684D0D0F2FB10F009F6555 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = sdch; + targetProxy = 82684D0C0F2FB10F009F6555 /* PBXContainerItemProxy */; + }; + 826852150F2FD152009F6555 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = libpng; + targetProxy = 826852140F2FD152009F6555 /* PBXContainerItemProxy */; + }; + 8268521B0F2FD197009F6555 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + name = sdch; + targetProxy = 8268521A0F2FD197009F6555 /* PBXContainerItemProxy */; + }; B503E1020F017BE300547DC6 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = 4D640CEA0EAE86BD00EBCFC0 /* renderer */; diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index 35cb15f..c910e30 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -29,17 +29,17 @@ const wchar_t kBrowserResourcesDll[] = L"chrome.dll"; // filenames const wchar_t kArchivedHistoryFilename[] = L"Archived History"; -const wchar_t kCacheDirname[] = L"Cache"; +const FilePath::CharType kCacheDirname[] = FPL("Cache"); const wchar_t kChromePluginDataDirname[] = L"Plugin Data"; -const wchar_t kCookieFilename[] = L"Cookies"; -const wchar_t kHistoryFilename[] = L"History"; +const FilePath::CharType kCookieFilename[] = FPL("Cookies"); +const FilePath::CharType kHistoryFilename[] = FPL("History"); const wchar_t kLocalStateFilename[] = L"Local State"; -const wchar_t kPreferencesFilename[] = L"Preferences"; +const FilePath::CharType kPreferencesFilename[] = FPL("Preferences"); const FilePath::CharType kSafeBrowsingFilename[] = FPL("Safe Browsing"); const wchar_t kThumbnailsFilename[] = L"Thumbnails"; const wchar_t kUserDataDirname[] = L"User Data"; -const wchar_t kUserScriptsDirname[] = L"User Scripts"; -const wchar_t kWebDataFilename[] = L"Web Data"; +const FilePath::CharType kUserScriptsDirname[] = FPL("User Scripts"); +const FilePath::CharType kWebDataFilename[] = FPL("Web Data"); const wchar_t kBookmarksFileName[] = L"Bookmarks"; const wchar_t kHistoryBookmarksFileName[] = L"Bookmarks From History"; const wchar_t kCustomDictionaryFileName[] = L"Custom Dictionary.txt"; diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index 2cf8c2d..cd67441 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -24,17 +24,17 @@ extern const wchar_t kBrowserResourcesDll[]; // filenames extern const wchar_t kArchivedHistoryFilename[]; -extern const wchar_t kCacheDirname[]; +extern const FilePath::CharType kCacheDirname[]; extern const wchar_t kChromePluginDataDirname[]; -extern const wchar_t kCookieFilename[]; -extern const wchar_t kHistoryFilename[]; +extern const FilePath::CharType kCookieFilename[]; +extern const FilePath::CharType kHistoryFilename[]; extern const wchar_t kLocalStateFilename[]; -extern const wchar_t kPreferencesFilename[]; +extern const FilePath::CharType kPreferencesFilename[]; extern const FilePath::CharType kSafeBrowsingFilename[]; extern const wchar_t kThumbnailsFilename[]; extern const wchar_t kUserDataDirname[]; -extern const wchar_t kUserScriptsDirname[]; -extern const wchar_t kWebDataFilename[]; +extern const FilePath::CharType kUserScriptsDirname[]; +extern const FilePath::CharType kWebDataFilename[]; extern const wchar_t kBookmarksFileName[]; extern const wchar_t kHistoryBookmarksFileName[]; extern const wchar_t kCustomDictionaryFileName[]; diff --git a/chrome/common/temp_scaffolding_stubs.cpp b/chrome/common/temp_scaffolding_stubs.cpp index 3d5037c..95dc2d4 100644 --- a/chrome/common/temp_scaffolding_stubs.cpp +++ b/chrome/common/temp_scaffolding_stubs.cpp @@ -10,7 +10,10 @@ #include "base/singleton.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_shutdown.h" +#include "chrome/browser/history/in_memory_history_backend.h" #include "chrome/browser/plugin_service.h" +#include "chrome/browser/profile_manager.h" +#include "chrome/browser/rlz/rlz.h" #include "chrome/browser/shell_integration.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" @@ -122,51 +125,6 @@ UserDataManager* UserDataManager::Get() { return instance_; } -//-------------------------------------------------------------------------- - -std::wstring ProfileManager::GetDefaultProfileDir( - const std::wstring& user_data_dir) { - std::wstring default_profile_dir(user_data_dir); - file_util::AppendToPath(&default_profile_dir, chrome::kNotSignedInProfile); - return default_profile_dir; -} - -std::wstring ProfileManager::GetDefaultProfilePath( - const std::wstring &profile_dir) { - std::wstring default_prefs_path(profile_dir); - file_util::AppendToPath(&default_prefs_path, chrome::kPreferencesFilename); - return default_prefs_path; -} - -Profile* ProfileManager::GetDefaultProfile(const std::wstring& user_data_dir) { - std::wstring default_profile_dir = GetDefaultProfileDir(user_data_dir); - return new Profile(default_profile_dir); -} - -Profile* ProfileManager::FakeProfile() { - return new Profile(L""); -} - -//-------------------------------------------------------------------------- - -Profile::Profile(const std::wstring& path) - : path_(path) { -} - -std::wstring Profile::GetPrefFilePath() { - std::wstring pref_file_path = path_; - file_util::AppendToPath(&pref_file_path, chrome::kPreferencesFilename); - return pref_file_path; -} - -PrefService* Profile::GetPrefs() { - if (!prefs_.get()) - prefs_.reset(new PrefService(GetPrefFilePath())); - return prefs_.get(); -} - -//-------------------------------------------------------------------------- - bool ShellIntegration::SetAsDefaultBrowser() { return true; } @@ -209,7 +167,7 @@ PluginService::PluginService() PluginService::~PluginService() { } -void PluginService::SetChromePluginDataDir(const std::wstring& data_dir) { +void PluginService::SetChromePluginDataDir(const FilePath& data_dir) { AutoLock lock(lock_); chrome_plugin_data_dir_ = data_dir; } @@ -247,3 +205,21 @@ TabContents* TabContents::CreateWithType(TabContentsType type, return new TabContents; } +//-------------------------------------------------------------------------- + +bool RLZTracker::GetAccessPointRlz(AccessPoint point, std::wstring* rlz) { + return false; +} + +bool RLZTracker::RecordProductEvent(Product product, AccessPoint point, + Event event) { + return false; +} + +// We link this in for now to avoid hauling in all of WebCore (which we will +// have to eventually do) +namespace webkit_glue { +std::string GetUserAgent(const GURL& url) { + return ""; +} +} diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index c4152ba..03f3c146 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -6,15 +6,18 @@ #define CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ // This file provides declarations and stub definitions for classes we encouter -// during the porting effort. It is not meant to be perminent, and classes will +// during the porting effort. It is not meant to be permanent, and classes will // be removed from here as they are fleshed out more completely. #include <string> #include "base/basictypes.h" +#include "base/file_path.h" #include "base/ref_counted.h" #include "base/gfx/rect.h" +#include "chrome/browser/bookmarks/bookmark_service.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/search_engines/template_url.h" #include "chrome/browser/tab_contents/tab_contents_type.h" #include "chrome/common/page_transition_types.h" #include "googleurl/src/gurl.h" @@ -56,7 +59,7 @@ class Upgrade { // to achieve this on other platforms and see if this API works. class MessageWindow { public: - explicit MessageWindow(const std::wstring& user_data_dir) { } + explicit MessageWindow(const FilePath& user_data_dir) { } ~MessageWindow() { } bool NotifyOtherProcess() { return false; } void HuntForZombieChromeProcesses() { } @@ -83,8 +86,8 @@ class BrowserInit { class FirstRun { public: static bool IsChromeFirstRun() { return false; } - static bool ProcessMasterPreferences(const std::wstring& user_data_dir, - const std::wstring& master_prefs_path, + static bool ProcessMasterPreferences(const FilePath& user_data_dir, + const FilePath& master_prefs_path, int* preference_details) { return false; } @@ -173,14 +176,18 @@ class UserDataManager { static UserDataManager* instance_; }; -struct SessionService { +class SessionService : public base::RefCountedThreadSafe<SessionService> { + public: + explicit SessionService(Profile* profile) { } void WindowClosed(const SessionID &) { } void SetWindowBounds(const SessionID&, const gfx::Rect&, bool) { } + void ResetFromCurrentBrowsers() { } void TabRestored(NavigationController*) { } }; -class TabRestoreService { +class TabRestoreService : public base::RefCountedThreadSafe<TabRestoreService> { public: + explicit TabRestoreService(Profile* profile) { } void BrowserClosing(Browser*) { } void BrowserClosed(Browser*) { } void CreateHistoricalTab(NavigationController*) { } @@ -197,7 +204,8 @@ class HistoryService { }; HistoryService() {} - bool Init(const std::wstring& history_dir, BookmarkService* bookmark_service) + HistoryService(Profile* profile) {} + bool Init(const FilePath& history_dir, BookmarkService* bookmark_service) { return false; } void SetOnBackendDestroyTask(Task*) {} void AddPage(GURL const&, void const*, int, GURL const&, @@ -210,55 +218,12 @@ class HistoryService { void Release() {} }; -class Profile { +namespace history { +class HistoryDatabase { public: - enum ServiceAccessType { - EXPLICIT_ACCESS, - IMPLICIT_ACCESS - }; - - public: - Profile(const std::wstring& user_data_dir); - virtual std::wstring GetPath() { return path_; } - virtual PrefService* GetPrefs(); - void ResetTabRestoreService() { } - SpellChecker* GetSpellChecker() { return NULL; } - VisitedLinkMaster* GetVisitedLinkMaster() { return NULL; } - TabRestoreService* GetTabRestoreService() { return NULL; } - SessionService* GetSessionService() { return NULL; } - UserScriptMaster* GetUserScriptMaster() { return NULL; } - bool IsOffTheRecord() { return false; } - URLRequestContext* GetRequestContext() { return NULL; } - virtual Profile* GetOriginalProfile() { return this; } - virtual Profile* GetOffTheRecordProfile() { return this; } - bool HasSessionService() { return false; } - std::wstring GetID() { return L""; } - HistoryService* GetHistoryService(ServiceAccessType access) { - return &history_service_; - } - - private: - std::wstring GetPrefFilePath(); - - std::wstring path_; - scoped_ptr<PrefService> prefs_; - HistoryService history_service_; -}; - -class ProfileManager : NonThreadSafe { - public: - ProfileManager() { } - virtual ~ProfileManager() { } - Profile* GetDefaultProfile(const std::wstring& user_data_dir); - static std::wstring GetDefaultProfileDir(const std::wstring& user_data_dir); - static std::wstring GetDefaultProfilePath(const std::wstring& profile_dir); - static void ShutdownSessionServices() { } - // This doesn't really exist, but is used when there is no browser window - // from which to get the profile. We'll find a better solution later. - static Profile* FakeProfile(); - private: - DISALLOW_EVIL_CONSTRUCTORS(ProfileManager); + static std::string GURLToDatabaseURL(const GURL& url) { return ""; } }; +} class MetricsService { public: @@ -417,4 +382,59 @@ class WindowSizer { bool* maximized) { } }; +//--------------------------------------------------------------------------- +// These stubs are for Profile + +class DownloadManager : public base::RefCountedThreadSafe<DownloadManager> { + public: + bool Init(Profile* profile) { return true; } +}; + +class TemplateURLFetcher { + public: + explicit TemplateURLFetcher(Profile* profile) { } + bool Init(Profile* profile) { return true; } +}; + +namespace base { +class SharedMemory; +} + +class Encryptor { + public: + static bool EncryptWideString(const std::wstring& plaintext, + std::string* ciphertext) { return false; } + + static bool DecryptWideString(const std::string& ciphertext, + std::wstring* plaintext) { return false; } +}; + +class BookmarkModel : public BookmarkService { + public: + explicit BookmarkModel(Profile* profile) { } + virtual ~BookmarkModel() { } + void Load() { } + virtual bool IsBookmarked(const GURL& url) { return false; } + virtual void GetBookmarks(std::vector<GURL>* urls) { } + virtual void BlockTillLoaded() { } +}; + +class SpellChecker : public base::RefCountedThreadSafe<SpellChecker> { + public: + typedef std::wstring Language; + SpellChecker(const std::wstring& dict_dir, + const Language& language, + URLRequestContext* request_context, + const std::wstring& custom_dictionary_file_name) {} +}; + +class TemplateURLModel { + public: + explicit TemplateURLModel(Profile* profile) { } + static std::wstring GenerateKeyword(const GURL& url, bool autodetected) { + return L""; + } + static GURL GenerateSearchURL(const TemplateURL* t_url) { return GURL(); } +}; + #endif // CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index 7a368dc..7e46932 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -50,7 +50,7 @@ TestingProfile::TestingProfile() off_the_record_(false), last_session_exited_cleanly_(true) { PathService::Get(base::DIR_TEMP, &path_); - file_util::AppendToPath(&path_, L"TestingProfilePath"); + path_ = path_.Append(FILE_PATH_LITERAL("TestingProfilePath")); file_util::Delete(path_, true); file_util::CreateDirectory(path_); } @@ -61,7 +61,8 @@ TestingProfile::TestingProfile(int count) off_the_record_(false), last_session_exited_cleanly_(true) { PathService::Get(base::DIR_TEMP, &path_); - file_util::AppendToPath(&path_, L"TestingProfilePath" + IntToWString(count)); + path_ = path_.Append(FILE_PATH_LITERAL("TestingProfilePath")); + path_ = path_.AppendASCII(IntToString(count)); file_util::Delete(path_, true); file_util::CreateDirectory(path_); } @@ -78,8 +79,8 @@ void TestingProfile::CreateHistoryService(bool delete_file) { history_service_ = NULL; if (delete_file) { - std::wstring path = GetPath(); - file_util::AppendToPath(&path, chrome::kHistoryFilename); + FilePath path = GetPath(); + path = path.Append(chrome::kHistoryFilename); file_util::Delete(path, false); } history_service_ = new HistoryService(this); @@ -112,8 +113,8 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) { bookmark_bar_model_.reset(NULL); if (delete_file) { - std::wstring path = GetPath(); - file_util::AppendToPath(&path, chrome::kBookmarksFileName); + FilePath path = GetPath(); + path = path.Append(chrome::kBookmarksFileName); file_util::Delete(path, false); } bookmark_bar_model_.reset(new BookmarkModel(this)); diff --git a/chrome/test/testing_profile.h b/chrome/test/testing_profile.h index adc6626..83f9167 100644 --- a/chrome/test/testing_profile.h +++ b/chrome/test/testing_profile.h @@ -48,7 +48,7 @@ class TestingProfile : public Profile { // Creates a TemplateURLModel. If not invoked the TemplateURLModel is NULL. void CreateTemplateURLModel(); - virtual std::wstring GetPath() { + virtual FilePath GetPath() { return path_; } // Sets whether we're off the record. Default is false. @@ -176,7 +176,7 @@ class TestingProfile : public Profile { protected: // The path of the profile; the various database and other files are relative // to this. - std::wstring path_; + FilePath path_; base::Time start_time_; scoped_ptr<PrefService> prefs_; diff --git a/chrome/test/unit/chrome_test_suite.h b/chrome/test/unit/chrome_test_suite.h index b2c196b..705960b 100644 --- a/chrome/test/unit/chrome_test_suite.h +++ b/chrome/test/unit/chrome_test_suite.h @@ -59,7 +59,10 @@ protected: #endif // initialize the global StatsTable for unit_tests - stats_table_ = new StatsTable("unit_tests", 20, 200); + std::string statsfile = "unit_tests"; + std::string pid_string = StringPrintf("-%d", base::GetCurrentProcId()); + statsfile += pid_string; + stats_table_ = new StatsTable(statsfile, 20, 200); StatsTable::set_current(stats_table_); } diff --git a/chrome/tools/profiles/generate_profile.cc b/chrome/tools/profiles/generate_profile.cc index 0971879..6e99e45 100644 --- a/chrome/tools/profiles/generate_profile.cc +++ b/chrome/tools/profiles/generate_profile.cc @@ -8,6 +8,7 @@ #include "chrome/tools/profiles/thumbnail-inl.h" #include "base/at_exit.h" +#include "base/file_path.h" #include "base/gfx/jpeg_codec.h" #include "base/icu_util.h" #include "base/message_loop.h" @@ -93,7 +94,7 @@ std::wstring ConstructRandomPage() { void InsertURLBatch(const std::wstring& profile_dir, int page_id, int batch_size, bool history_only) { scoped_refptr<HistoryService> history_service(new HistoryService); - if (!history_service->Init(profile_dir, NULL)) { + if (!history_service->Init(FilePath::FromWStringHack(profile_dir), NULL)) { printf("Could not init the history service\n"); exit(1); } |