OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ | 5 #ifndef CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ |
6 #define CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ | 6 #define CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ |
7 | 7 |
8 // This file provides declarations and stub definitions for classes we encouter | 8 // This file provides declarations and stub definitions for classes we encouter |
9 // during the porting effort. It is not meant to be perminent, and classes will | 9 // during the porting effort. It is not meant to be perminent, and classes will |
10 // be removed from here as they are fleshed out more completely. | 10 // be removed from here as they are fleshed out more completely. |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
15 #include "base/ref_counted.h" | 15 #include "base/ref_counted.h" |
16 #include "base/gfx/rect.h" | 16 #include "base/gfx/rect.h" |
17 #include "chrome/browser/browser_process.h" | 17 #include "chrome/browser/browser_process.h" |
18 #include "chrome/browser/tab_contents/tab_contents_type.h" | 18 #include "chrome/browser/tab_contents/tab_contents_type.h" |
19 #include "chrome/common/page_transition_types.h" | 19 #include "chrome/common/page_transition_types.h" |
20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
21 #include "skia/include/SkBitmap.h" | 21 #include "skia/include/SkBitmap.h" |
22 #include "webkit/glue/window_open_disposition.h" | 22 #include "webkit/glue/window_open_disposition.h" |
23 | 23 |
24 class Browser; | 24 class Browser; |
| 25 class BookmarkService; |
25 class CommandLine; | 26 class CommandLine; |
| 27 class HistoryService; |
26 class MetricsService; | 28 class MetricsService; |
27 class NavigationEntry; | 29 class NavigationEntry; |
28 class ProfileManager; | 30 class ProfileManager; |
29 class Profile; | 31 class Profile; |
30 class SessionID; | 32 class SessionID; |
| 33 class SpellChecker; |
31 class TabContents; | 34 class TabContents; |
32 class URLRequestContext; | 35 class URLRequestContext; |
| 36 class UserScriptMaster; |
| 37 class VisitedLinkMaster; |
33 class WebContents; | 38 class WebContents; |
34 | 39 |
35 //--------------------------------------------------------------------------- | 40 //--------------------------------------------------------------------------- |
36 // These stubs are for Browser_main() | 41 // These stubs are for Browser_main() |
37 | 42 |
38 class Upgrade { | 43 class Upgrade { |
39 public: | 44 public: |
40 static bool IsBrowserAlreadyRunning() { return false; } | 45 static bool IsBrowserAlreadyRunning() { return false; } |
41 static bool RelaunchChromeBrowser(const CommandLine& command_line) { | 46 static bool RelaunchChromeBrowser(const CommandLine& command_line) { |
42 return true; | 47 return true; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 void WindowClosed(const SessionID &) { } | 173 void WindowClosed(const SessionID &) { } |
169 void SetWindowBounds(const SessionID&, const gfx::Rect&, bool) { } | 174 void SetWindowBounds(const SessionID&, const gfx::Rect&, bool) { } |
170 }; | 175 }; |
171 | 176 |
172 class TabRestoreService { | 177 class TabRestoreService { |
173 public: | 178 public: |
174 void BrowserClosing(Browser*) { } | 179 void BrowserClosing(Browser*) { } |
175 void BrowserClosed(Browser*) { } | 180 void BrowserClosed(Browser*) { } |
176 }; | 181 }; |
177 | 182 |
| 183 class HistoryService { |
| 184 public: |
| 185 |
| 186 class URLEnumerator { |
| 187 public: |
| 188 virtual ~URLEnumerator() {} |
| 189 virtual void OnURL(const GURL& url) = 0; |
| 190 virtual void OnComplete(bool success) = 0; |
| 191 }; |
| 192 |
| 193 HistoryService() {} |
| 194 bool Init(const std::wstring& history_dir, BookmarkService* bookmark_service) |
| 195 { return false; } |
| 196 void SetOnBackendDestroyTask(Task*) {} |
| 197 void AddPage(GURL const&, void const*, int, GURL const&, |
| 198 int, std::vector<GURL> const&) {} |
| 199 void AddPage(const GURL& url) {} |
| 200 void SetPageContents(const GURL& url, const std::wstring& contents) {} |
| 201 void IterateURLs(URLEnumerator* iterator) {} |
| 202 void Cleanup() {} |
| 203 void AddRef() {} |
| 204 void Release() {} |
| 205 }; |
| 206 |
178 class Profile { | 207 class Profile { |
179 public: | 208 public: |
| 209 enum ServiceAccessType { |
| 210 EXPLICIT_ACCESS, |
| 211 IMPLICIT_ACCESS |
| 212 }; |
| 213 |
| 214 public: |
180 Profile(const std::wstring& user_data_dir); | 215 Profile(const std::wstring& user_data_dir); |
181 virtual std::wstring GetPath() { return path_; } | 216 virtual std::wstring GetPath() { return path_; } |
182 virtual PrefService* GetPrefs(); | 217 virtual PrefService* GetPrefs(); |
183 void ResetTabRestoreService() { } | 218 void ResetTabRestoreService() { } |
| 219 SpellChecker* GetSpellChecker() { return NULL; } |
| 220 VisitedLinkMaster* GetVisitedLinkMaster() { return NULL; } |
184 TabRestoreService* GetTabRestoreService() { return NULL; } | 221 TabRestoreService* GetTabRestoreService() { return NULL; } |
185 SessionService* GetSessionService() { return NULL; } | 222 SessionService* GetSessionService() { return NULL; } |
| 223 UserScriptMaster* GetUserScriptMaster() { return NULL; } |
186 bool IsOffTheRecord() { return false; } | 224 bool IsOffTheRecord() { return false; } |
187 URLRequestContext* GetRequestContext() { return NULL; } | 225 URLRequestContext* GetRequestContext() { return NULL; } |
188 virtual Profile* GetOriginalProfile() { return this; } | 226 virtual Profile* GetOriginalProfile() { return this; } |
189 virtual Profile* GetOffTheRecordProfile() { return this; } | 227 virtual Profile* GetOffTheRecordProfile() { return this; } |
190 bool HasSessionService() { return false; } | 228 bool HasSessionService() { return false; } |
| 229 std::wstring GetID() { return L""; } |
| 230 HistoryService* GetHistoryService(ServiceAccessType access) { |
| 231 return &history_service_; |
| 232 } |
| 233 |
191 private: | 234 private: |
192 std::wstring GetPrefFilePath(); | 235 std::wstring GetPrefFilePath(); |
193 | 236 |
194 std::wstring path_; | 237 std::wstring path_; |
195 scoped_ptr<PrefService> prefs_; | 238 scoped_ptr<PrefService> prefs_; |
| 239 HistoryService history_service_; |
196 }; | 240 }; |
197 | 241 |
198 class ProfileManager : NonThreadSafe { | 242 class ProfileManager : NonThreadSafe { |
199 public: | 243 public: |
200 ProfileManager() { } | 244 ProfileManager() { } |
201 virtual ~ProfileManager() { } | 245 virtual ~ProfileManager() { } |
202 Profile* GetDefaultProfile(const std::wstring& user_data_dir); | 246 Profile* GetDefaultProfile(const std::wstring& user_data_dir); |
203 static std::wstring GetDefaultProfileDir(const std::wstring& user_data_dir); | 247 static std::wstring GetDefaultProfileDir(const std::wstring& user_data_dir); |
204 static std::wstring GetDefaultProfilePath(const std::wstring& profile_dir); | 248 static std::wstring GetDefaultProfilePath(const std::wstring& profile_dir); |
205 static void ShutdownSessionServices() { } | 249 static void ShutdownSessionServices() { } |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 | 428 |
385 class WindowSizer { | 429 class WindowSizer { |
386 public: | 430 public: |
387 static void GetBrowserWindowBounds(const std::wstring& app_name, | 431 static void GetBrowserWindowBounds(const std::wstring& app_name, |
388 const gfx::Rect& specified_bounds, | 432 const gfx::Rect& specified_bounds, |
389 gfx::Rect* window_bounds, | 433 gfx::Rect* window_bounds, |
390 bool* maximized) { } | 434 bool* maximized) { } |
391 }; | 435 }; |
392 | 436 |
393 #endif // CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ | 437 #endif // CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ |
OLD | NEW |