diff options
author | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-06 20:12:07 +0000 |
---|---|---|
committer | avi@google.com <avi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-06 20:12:07 +0000 |
commit | b8615376ec35c6b328ec67325289e0b126f5f4cd (patch) | |
tree | d93d9ab0f28bdb48abfcdfbc0500b75d20369367 /chrome/common | |
parent | 3ddb7b91615c7c81d6723c061c106b430294b05f (diff) | |
download | chromium_src-b8615376ec35c6b328ec67325289e0b126f5f4cd.zip chromium_src-b8615376ec35c6b328ec67325289e0b126f5f4cd.tar.gz chromium_src-b8615376ec35c6b328ec67325289e0b126f5f4cd.tar.bz2 |
Initial Mac port of web_contents_view and render_widget_host_view.
Review URL: http://codereview.chromium.org/20124
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9330 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.cc | 32 | ||||
-rw-r--r-- | chrome/common/temp_scaffolding_stubs.h | 106 |
2 files changed, 36 insertions, 102 deletions
diff --git a/chrome/common/temp_scaffolding_stubs.cc b/chrome/common/temp_scaffolding_stubs.cc index 661f632..b79214f 100644 --- a/chrome/common/temp_scaffolding_stubs.cc +++ b/chrome/common/temp_scaffolding_stubs.cc @@ -166,13 +166,22 @@ void Browser::LoadingStateChanged(TabContents* source) { TabContents* TabContents::CreateWithType(TabContentsType type, Profile* profile, SiteInstance* instance) { + TabContents* contents; + switch (type) { case TAB_CONTENTS_WEB: - return new WebContents(profile, instance, NULL, MSG_ROUTING_NONE, NULL); + contents = new WebContents(profile, instance, NULL, MSG_ROUTING_NONE, + NULL); + break; default: - NOTIMPLEMENTED(); - return NULL; + NOTREACHED() << "Don't know how to create tab contents of type " << type; + contents = NULL; } + + if (contents) + contents->CreateView(); + + return contents; } void TabContents::SetupController(Profile* profile) { @@ -213,23 +222,6 @@ void TabContents::Destroy() { //-------------------------------------------------------------------------- -#if defined(OS_MACOSX) -class RenderWidgetHostViewStub : public RenderWidgetHostView { - public: - RenderWidgetHostViewStub(RenderWidgetHost* host) { - host->set_view(this); - } -}; - -RenderWidgetHostView* - WebContentsView::CreateViewForWidget(RenderWidgetHost* host) { - NOTIMPLEMENTED(); - return new RenderWidgetHostViewStub(host); -} -#endif // defined(OS_MACOSX) - -//-------------------------------------------------------------------------- - bool RLZTracker::GetAccessPointRlz(AccessPoint point, std::wstring* rlz) { NOTIMPLEMENTED(); return false; diff --git a/chrome/common/temp_scaffolding_stubs.h b/chrome/common/temp_scaffolding_stubs.h index 605421e..82cfb6d 100644 --- a/chrome/common/temp_scaffolding_stubs.h +++ b/chrome/common/temp_scaffolding_stubs.h @@ -77,6 +77,7 @@ class URLRequestContext; class UserScriptMaster; class VisitedLinkMaster; class WebContents; +class WebContentsView; struct WebPluginInfo; struct WebPluginGeometry; class WebPreferences; @@ -620,39 +621,6 @@ class ConfirmInfoBarDelegate : public InfoBarDelegate { }; }; -#if defined(OS_MACOSX) -class RenderWidgetHostView { - public: - virtual RenderWidgetHost* GetRenderWidgetHost() const { - NOTIMPLEMENTED(); - return NULL; - } - virtual void DidBecomeSelected() { NOTIMPLEMENTED(); } - virtual void WasHidden() { NOTIMPLEMENTED(); } - virtual void SetSize(const gfx::Size&) { NOTIMPLEMENTED(); } - virtual gfx::NativeView GetPluginNativeView() - { NOTIMPLEMENTED(); return NULL; }; - virtual void MovePluginWindows(const std::vector<WebPluginGeometry>&) - { NOTIMPLEMENTED(); } - virtual void Focus() { NOTIMPLEMENTED(); } - virtual void Blur() { NOTIMPLEMENTED(); } - virtual bool HasFocus() { NOTIMPLEMENTED(); return false; } - virtual void Show() { NOTIMPLEMENTED(); } - virtual void Hide() { NOTIMPLEMENTED(); } - virtual gfx::Rect GetViewBounds() const - { NOTIMPLEMENTED(); return gfx::Rect(); } - virtual void UpdateCursor(const WebCursor&) { NOTIMPLEMENTED(); } - virtual void UpdateCursorIfOverSelf() { NOTIMPLEMENTED(); } - virtual void SetIsLoading(bool) { NOTIMPLEMENTED(); } - virtual void IMEUpdateStatus(int, const gfx::Rect&) { NOTIMPLEMENTED(); } - virtual void DidPaintRect(const gfx::Rect&) { NOTIMPLEMENTED(); } - virtual void DidScrollRect(const gfx::Rect&, int, int) { NOTIMPLEMENTED(); } - virtual void RendererGone() { NOTIMPLEMENTED(); } - virtual void Destroy() { NOTIMPLEMENTED(); } - virtual void SetTooltipText(const std::wstring&) { NOTIMPLEMENTED(); } -}; -#endif // defined(MAC_OSX) - class LoadNotificationDetails { public: LoadNotificationDetails(const GURL&, PageTransition::Type, @@ -742,6 +710,10 @@ class TabContents : public NotificationObserver { void AddInfoBar(InfoBarDelegate*) { NOTIMPLEMENTED(); } virtual void OpenURL(const GURL&, const GURL&, WindowOpenDisposition, PageTransition::Type) { NOTIMPLEMENTED(); } + void AddNewContents(TabContents* new_contents, + WindowOpenDisposition disposition, + const gfx::Rect& initial_pos, + bool user_gesture) { NOTIMPLEMENTED(); } virtual void Activate() { NOTIMPLEMENTED(); } virtual bool SupportsURL(GURL*) { NOTIMPLEMENTED(); return false; } virtual SiteInstance* GetSiteInstance() const { return NULL; } @@ -756,6 +728,7 @@ class TabContents : public NotificationObserver { static void MigrateShelfView(TabContents* from, TabContents* to) { NOTIMPLEMENTED(); } + virtual void CreateView() {} protected: typedef std::vector<ConstrainedWindow*> ConstrainedWindowList; ConstrainedWindowList child_windows_; @@ -778,7 +751,7 @@ class SelectFileDialog : public base::RefCountedThreadSafe<SelectFileDialog> { }; void ListenerDestroyed() { NOTIMPLEMENTED(); } void SelectFile(Type, const std::wstring&, const std::wstring&, - const std::wstring&, const std::wstring&, gfx::NativeView, + const std::wstring&, const std::wstring&, gfx::NativeWindow, void*) { NOTIMPLEMENTED(); } static SelectFileDialog* Create(WebContents*) { NOTIMPLEMENTED(); @@ -928,54 +901,6 @@ class URLFixerUpper { //--------------------------------------------------------------------------- // These stubs are for WebContents -#if defined(OS_MACOSX) -class WebContentsView : public RenderViewHostDelegate::View { - public: - void OnContentsDestroy() { NOTIMPLEMENTED(); } - void* GetNativeView() { - NOTIMPLEMENTED(); - return NULL; - } - void HideFindBar(bool) { NOTIMPLEMENTED(); } - void Invalidate() { NOTIMPLEMENTED(); } - static WebContentsView* Create(WebContents*) { - NOTIMPLEMENTED(); - return new WebContentsView; - } - gfx::NativeView GetTopLevelNativeView() const { - NOTIMPLEMENTED(); - return NULL; - } - gfx::Size GetContainerSize() const { - NOTIMPLEMENTED(); - return gfx::Size(); - } - void SizeContents(const gfx::Size& size) { NOTIMPLEMENTED(); } - RenderWidgetHostView* CreateViewForWidget(RenderWidgetHost*); - void RenderWidgetHostDestroyed(RenderWidgetHost*) { NOTIMPLEMENTED(); } - void SetPageTitle(const std::wstring&) { NOTIMPLEMENTED(); } - virtual void CreateNewWindow(int, - base::WaitableEvent*) { NOTIMPLEMENTED(); } - virtual void CreateNewWidget(int, bool) { NOTIMPLEMENTED(); } - virtual void ShowCreatedWindow(int, WindowOpenDisposition, - const gfx::Rect&, bool) { NOTIMPLEMENTED(); } - virtual void ShowCreatedWidget(int, const gfx::Rect&) { NOTIMPLEMENTED(); } - virtual void ShowContextMenu(const ContextMenuParams&) { NOTIMPLEMENTED(); } - virtual void StartDragging(const WebDropData&) { NOTIMPLEMENTED(); } - virtual void UpdateDragCursor(bool) { NOTIMPLEMENTED(); } - virtual void TakeFocus(bool) { NOTIMPLEMENTED(); } - virtual void HandleKeyboardEvent(const WebKeyboardEvent&) - { NOTIMPLEMENTED(); } - virtual void OnFindReply(int, int, const gfx::Rect&, int, - bool) { NOTIMPLEMENTED(); } -}; - -class WebContentsViewWin : public WebContentsView { - public: - WebContentsViewWin(WebContents*) { } -}; -#endif // defined(OS_MACOSX) - class WebApp : public base::RefCountedThreadSafe<WebApp> { public: class Observer { @@ -1142,6 +1067,23 @@ class SimpleAlertInfoBarDelegate : public InfoBarDelegate { SimpleAlertInfoBarDelegate(WebContents*, const std::wstring&, void*) {} }; +#if defined(OS_MACOSX) +class FindBarMac { + public: + FindBarMac(WebContentsView*, gfx::NativeWindow) { } + void Show() { } + void Close() { } + void StartFinding(bool&) { } + void EndFindSession() { } + void DidBecomeUnselected() { } + bool IsVisible() { return false; } + bool IsAnimating() { return false; } + gfx::NativeView GetView() { return nil; } + std::string find_string() { return ""; } + void OnFindReply(int, int, const gfx::Rect&, int, bool) { } +}; +#endif + class LoginHandler { public: void SetAuth(const std::wstring& username, |