summaryrefslogtreecommitdiffstats
path: root/chrome/common
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/common')
-rw-r--r--chrome/common/chrome_constants.cc12
-rw-r--r--chrome/common/chrome_constants.h12
-rw-r--r--chrome/common/temp_scaffolding_stubs.cpp68
-rw-r--r--chrome/common/temp_scaffolding_stubs.h128
4 files changed, 108 insertions, 112 deletions
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_