summaryrefslogtreecommitdiffstats
path: root/chrome/common/temp_scaffolding_stubs.h
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 21:54:32 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-28 21:54:32 +0000
commitf7011fcb7f28651953b1765b241c974e25c8cd40 (patch)
treef3a2c97bb98cc12aaca39bb27791998f026b58b7 /chrome/common/temp_scaffolding_stubs.h
parent4663213354a9c41ab0e5a785d52bf5c9a9692514 (diff)
downloadchromium_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/common/temp_scaffolding_stubs.h')
-rw-r--r--chrome/common/temp_scaffolding_stubs.h128
1 files changed, 74 insertions, 54 deletions
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_