| 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 "chrome/browser/browser_process.h" | 16 #include "chrome/browser/browser_process.h" |
| 17 #include "chrome/browser/tab_contents/tab_contents_type.h" |
| 18 #include "chrome/common/page_transition_types.h" |
| 19 #include "googleurl/src/gurl.h" |
| 20 #include "skia/include/SkBitmap.h" |
| 21 #include "webkit/glue/window_open_disposition.h" |
| 17 | 22 |
| 18 class Browser; | 23 class Browser; |
| 19 class CommandLine; | 24 class CommandLine; |
| 20 class MetricsService; | 25 class MetricsService; |
| 26 class NavigationEntry; |
| 21 class ProfileManager; | 27 class ProfileManager; |
| 22 class Profile; | 28 class Profile; |
| 23 class SessionID; | 29 class SessionID; |
| 30 class TabContents; |
| 24 class URLRequestContext; | 31 class URLRequestContext; |
| 25 class WebContents; | 32 class WebContents; |
| 26 | 33 |
| 27 //--------------------------------------------------------------------------- | 34 //--------------------------------------------------------------------------- |
| 28 // These stubs are for Browser_main() | 35 // These stubs are for Browser_main() |
| 29 | 36 |
| 30 class Upgrade { | 37 class Upgrade { |
| 31 public: | 38 public: |
| 32 static bool IsBrowserAlreadyRunning() { return false; } | 39 static bool IsBrowserAlreadyRunning() { return false; } |
| 33 static bool RelaunchChromeBrowser(const CommandLine& command_line) { | 40 static bool RelaunchChromeBrowser(const CommandLine& command_line) { |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 void RegisterAllPrefs(PrefService*, PrefService*); | 223 void RegisterAllPrefs(PrefService*, PrefService*); |
| 217 } | 224 } |
| 218 | 225 |
| 219 void OpenFirstRunDialog(Profile* profile); | 226 void OpenFirstRunDialog(Profile* profile); |
| 220 | 227 |
| 221 void InstallJankometer(const CommandLine&); | 228 void InstallJankometer(const CommandLine&); |
| 222 | 229 |
| 223 //--------------------------------------------------------------------------- | 230 //--------------------------------------------------------------------------- |
| 224 // These stubs are for Browser | 231 // These stubs are for Browser |
| 225 | 232 |
| 233 class SavePackage { |
| 234 public: |
| 235 static bool IsSavableContents(const std::string& contents_mime_type) { |
| 236 return false; |
| 237 } |
| 238 static bool IsSavableURL(const GURL& url) { return false; } |
| 239 }; |
| 240 |
| 226 class LocationBarView { | 241 class LocationBarView { |
| 227 public: | 242 public: |
| 228 void ShowFirstRunBubble() { } | 243 void ShowFirstRunBubble() { } |
| 229 }; | 244 }; |
| 230 | 245 |
| 246 class GoButton { |
| 247 public: |
| 248 typedef enum Mode { MODE_GO = 0, MODE_STOP }; |
| 249 void ChangeMode(Mode mode) { } |
| 250 }; |
| 251 |
| 252 class ToolbarStarToggle { |
| 253 public: |
| 254 void SetToggled(bool) { } |
| 255 }; |
| 256 |
| 231 class DebuggerWindow : public base::RefCountedThreadSafe<DebuggerWindow> { | 257 class DebuggerWindow : public base::RefCountedThreadSafe<DebuggerWindow> { |
| 232 public: | 258 public: |
| 233 }; | 259 }; |
| 234 | 260 |
| 235 class TabStripModelDelegate { | 261 class TabStripModelDelegate { |
| 236 public: | 262 public: |
| 237 }; | 263 }; |
| 238 | 264 |
| 239 class TabStripModelObserver { | 265 class TabStripModelObserver { |
| 240 public: | 266 public: |
| 241 }; | 267 }; |
| 242 | 268 |
| 269 class NavigationEntry { |
| 270 public: |
| 271 const GURL& url() const { return url_; } |
| 272 private: |
| 273 GURL url_; |
| 274 }; |
| 275 |
| 243 class NavigationController { | 276 class NavigationController { |
| 244 public: | 277 public: |
| 278 NavigationController() : entry_(new NavigationEntry) { } |
| 279 virtual ~NavigationController() { } |
| 280 bool CanGoBack() const { return false; } |
| 281 bool CanGoForward() const { return false; } |
| 282 void GoBack() { } |
| 283 void GoForward() { } |
| 284 void Reload(bool) { } |
| 285 TabContents* active_contents() const { return NULL; } |
| 286 NavigationEntry* GetLastCommittedEntry() const { return entry_.get(); } |
| 287 NavigationEntry* GetActiveEntry() const { return entry_.get(); } |
| 288 void LoadURL(const GURL& url, const GURL& referrer, |
| 289 PageTransition::Type type) { } |
| 290 private: |
| 291 scoped_ptr<NavigationEntry> entry_; |
| 245 }; | 292 }; |
| 246 | 293 |
| 247 class TabContentsDelegate { | 294 class TabContentsDelegate { |
| 248 public: | 295 public: |
| 296 virtual void OpenURL(const GURL& url, const GURL& referrer, |
| 297 WindowOpenDisposition disposition, |
| 298 PageTransition::Type transition) { } |
| 299 }; |
| 300 |
| 301 class InterstitialPage { |
| 302 public: |
| 303 virtual void DontProceed() { } |
| 249 }; | 304 }; |
| 250 | 305 |
| 251 class TabContents { | 306 class TabContents { |
| 252 public: | 307 public: |
| 253 TabContents() : controller_(new NavigationController) { } | 308 TabContents() : controller_(new NavigationController) { } |
| 309 virtual ~TabContents() { } |
| 254 NavigationController* controller() const { return controller_.get(); } | 310 NavigationController* controller() const { return controller_.get(); } |
| 255 WebContents* AsWebContents() const { return NULL; } | 311 virtual WebContents* AsWebContents() const { return NULL; } |
| 312 virtual SkBitmap GetFavIcon() const { return SkBitmap(); } |
| 313 const GURL& GetURL() const { return url_; } |
| 314 virtual const std::wstring& GetTitle() const { return title_; } |
| 315 TabContentsType type() const { return TAB_CONTENTS_WEB; } |
| 316 virtual void Focus() { } |
| 256 private: | 317 private: |
| 318 GURL url_; |
| 319 std::wstring title_; |
| 257 scoped_ptr<NavigationController> controller_; | 320 scoped_ptr<NavigationController> controller_; |
| 258 }; | 321 }; |
| 259 | 322 |
| 260 // fake a tab strip, though it can't have any entries because the browser dtor | 323 class WebContents : public TabContents { |
| 261 // checks. | 324 public: |
| 325 WebContents* AsWebContents() { return this; } |
| 326 bool showing_interstitial_page() const { return false; } |
| 327 InterstitialPage* interstitial_page() const { return NULL; } |
| 328 bool is_starred() const { return false; } |
| 329 const std::string& contents_mime_type() const { return mime_type_; } |
| 330 private: |
| 331 std::string mime_type_; |
| 332 }; |
| 333 |
| 334 // fake a tab strip with one entry. |
| 262 class TabStripModel { | 335 class TabStripModel { |
| 263 public: | 336 public: |
| 264 TabStripModel(TabStripModelDelegate* delegate, Profile* profile) | 337 TabStripModel(TabStripModelDelegate* delegate, Profile* profile) |
| 265 : contents_(new TabContents) { } | 338 : contents_(new WebContents) { } |
| 266 virtual ~TabStripModel() { } | 339 virtual ~TabStripModel() { } |
| 267 bool empty() const { return contents_.get() == NULL; } | 340 bool empty() const { return contents_.get() == NULL; } |
| 268 int count() const { return contents_.get() ? 1 : 0; } | 341 int count() const { return contents_.get() ? 1 : 0; } |
| 269 int selected_index() const { return 0; } | 342 int selected_index() const { return 0; } |
| 270 int GetIndexOfController(const NavigationController* controller) const { | 343 int GetIndexOfController(const NavigationController* controller) const { |
| 271 return 0; | 344 return 0; |
| 272 } | 345 } |
| 273 TabContents* GetTabContentsAt(int index) const { return contents_.get(); } | 346 TabContents* GetTabContentsAt(int index) const { return contents_.get(); } |
| 274 TabContents* GetSelectedTabContents() const { return contents_.get(); } | 347 TabContents* GetSelectedTabContents() const { return contents_.get(); } |
| 275 void SelectTabContentsAt(int index, bool user_gesture) { } | 348 void SelectTabContentsAt(int index, bool user_gesture) { } |
| (...skipping 19 matching lines...) Expand all Loading... |
| 295 | 368 |
| 296 class DockInfo { | 369 class DockInfo { |
| 297 public: | 370 public: |
| 298 }; | 371 }; |
| 299 | 372 |
| 300 class ToolbarModel { | 373 class ToolbarModel { |
| 301 public: | 374 public: |
| 302 }; | 375 }; |
| 303 | 376 |
| 304 #endif // CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ | 377 #endif // CHROME_COMMON_TEMP_SCAFFOLDING_STUBS_H_ |
| OLD | NEW |